Skip to content

Commit

Permalink
Added field is_hidden to method "market.editAlbum" (#1581)
Browse files Browse the repository at this point in the history
## List of changes
- added field *is_hidden* to args of method

### Warning
Cannot add test data for this method, cause need to have market with
admin rights

### Sources

[Source of method](https://dev.vk.com/ru/method/market.editAlbum)

Bound with issue #1222
  • Loading branch information
Rahovski authored Aug 28, 2023
1 parent a3efd52 commit cde6328
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion VkNet/Abstractions/Category/Async/IMarketsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Enums;
Expand Down Expand Up @@ -586,6 +586,9 @@ Task<long> AddAlbumAsync(long ownerId,
/// Идентификатор фотографии-обложки подборки. положительное число (положительное
/// число).
/// </param>
/// <param name="isHidden">
/// Информация о том, сделать ли подборку скрытой. 0 - не делать скрытой(по умолчанию). 1 - скрыть подборку
/// </param>
/// <param name="token">Токен отмены операции</param>
/// <param name="mainAlbum"> Назначить подборку основной (1 — назначить, 0 — нет). </param>
/// <returns>
Expand All @@ -599,6 +602,7 @@ Task<bool> EditAlbumAsync(long ownerId,
string title,
long? photoId = null,
bool mainAlbum = false,
bool isHidden = false,
CancellationToken token = default);

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions VkNet/Abstractions/Category/IMarketsCategory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using VkNet.Enums;
using VkNet.Model;
using VkNet.Utils;
Expand Down Expand Up @@ -66,7 +66,7 @@ public interface IMarketsCategory : IMarketsCategoryAsync
long AddAlbum(long ownerId, string title, long? photoId = null, bool mainAlbum = false);

/// <inheritdoc cref="IMarketsCategoryAsync.EditAlbumAsync"/>
bool EditAlbum(long ownerId, long albumId, string title, long? photoId = null, bool mainAlbum = false);
bool EditAlbum(long ownerId, long albumId, string title, long? photoId = null, bool mainAlbum = false, bool isHidden = false);

/// <inheritdoc cref="IMarketsCategoryAsync.DeleteAlbumAsync"/>
bool DeleteAlbum(long ownerId, long albumId);
Expand Down
3 changes: 2 additions & 1 deletion VkNet/Categories/Async/MarketsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,10 @@ public Task<bool> EditAlbumAsync(long ownerId,
string title,
long? photoId = null,
bool mainAlbum = false,
bool isHidden = false,
CancellationToken token = default) =>
TypeHelper.TryInvokeMethodAsync(() =>
EditAlbum(ownerId, albumId, title, photoId, mainAlbum), token);
EditAlbum(ownerId, albumId, title, photoId, mainAlbum, isHidden), token);

/// <inheritdoc />
public Task<bool> DeleteAlbumAsync(long ownerId,
Expand Down
5 changes: 4 additions & 1 deletion VkNet/Categories/MarketsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public long AddAlbum(long ownerId, string title, long? photoId = null, bool main
}

/// <inheritdoc />
public bool EditAlbum(long ownerId, long albumId, string title, long? photoId = null, bool mainAlbum = false)
public bool EditAlbum(long ownerId, long albumId, string title, long? photoId = null, bool mainAlbum = false, bool isHidden = false)
{
var parameters = new VkParameters
{
Expand All @@ -521,6 +521,9 @@ public bool EditAlbum(long ownerId, long albumId, string title, long? photoId =
},
{
"main_album", mainAlbum
},
{
"is_hidden", isHidden
}
};

Expand Down

0 comments on commit cde6328

Please sign in to comment.