Skip to content

Commit

Permalink
Added is_hidden field to market.addalbum (#1582)
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.addAlbum)

Bound with issue #1222
  • Loading branch information
Rahovski authored Sep 11, 2023
1 parent e4862c0 commit e00262b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions VkNet/Abstractions/Category/Async/IMarketsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ Task<bool> ReorderAlbumsAsync(long ownerId,
/// значения 1 или 0
/// (флаг, может принимать значения 1 или 0).
/// </param>
/// <param name="isHidden">
/// Информация о том, сделать ли подборку скрытой. 0 - не делать скрытой(по умолчанию). 1 - скрыть подборку
/// </param>
/// <param name="token">Токен отмены операции</param>
/// <returns>
/// После успешного выполнения возвращает идентификатор созданной подборки.
Expand All @@ -575,6 +578,7 @@ Task<long> AddAlbumAsync(long ownerId,
string title,
long? photoId = null,
bool mainAlbum = false,
bool isHidden = false,
CancellationToken token = default);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Abstractions/Category/IMarketsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public interface IMarketsCategory : IMarketsCategoryAsync
bool ReorderAlbums(long ownerId, long albumId, long? before = null, long? after = null);

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

/// <inheritdoc cref="IMarketsCategoryAsync.EditAlbumAsync"/>
bool EditAlbum(long ownerId, long albumId, string title, long? photoId = null, bool mainAlbum = false, bool isHidden = false);
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 @@ -155,9 +155,10 @@ public Task<long> AddAlbumAsync(long ownerId,
string title,
long? photoId = null,
bool mainAlbum = false,
bool isHidden = false,
CancellationToken token = default) =>
TypeHelper.TryInvokeMethodAsync(() =>
AddAlbum(ownerId, title, photoId, mainAlbum), token);
AddAlbum(ownerId, title, photoId, mainAlbum, isHidden), token);

/// <inheritdoc />
public Task<bool> EditAlbumAsync(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 @@ -518,7 +518,7 @@ public bool ReorderAlbums(long ownerId, long albumId, long? before = null, long?
}

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

Expand Down

0 comments on commit e00262b

Please sign in to comment.