Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Исправить часть warning, обновить некоторые методы из #1222 #1600

Merged
merged 20 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d9616e5
Local constant 'expectedUserId' is never used
1dNDN Nov 11, 2023
d98026d
Redundant 'Attribute' suffix
1dNDN Nov 11, 2023
e26de12
Dictionary lookup can be simplified with 'TryGetValue'
1dNDN Nov 11, 2023
1f381b3
S6608: Indexing at 0 should be used instead of the "Enumerable" exten…
1dNDN Nov 11, 2023
2aa86df
The keyword 'new' is required on 'AccessKey' because it hides propert…
1dNDN Nov 11, 2023
2c0c852
Using directive is not required by the code and can be safely removed
1dNDN Nov 11, 2023
252684b
The keyword 'new' is required on 'PhotoId' because it hides property …
1dNDN Nov 11, 2023
9afab49
Using directive is not required by the code and can be safely removed
1dNDN Nov 11, 2023
b9f9d5e
Conditional access qualifier expression is known to be not null
1dNDN Nov 11, 2023
f83797f
Cannot resolve symbol BotsLongPollUpdatesHandler
1dNDN Nov 11, 2023
96fd2db
Code is unreachable
1dNDN Nov 11, 2023
0be147e
Using directive is not required by the code and can be safely removed
1dNDN Nov 11, 2023
4d165e5
add only_deleted param to ads.getAds
1dNDN Nov 11, 2023
b2296f2
add only_deleted to ads.getAdsLayout
1dNDN Nov 11, 2023
3308cb1
add app_id to apps.get
1dNDN Nov 11, 2023
0d62075
add link_video to wall.postAdsStealth
1dNDN Nov 11, 2023
1225a67
add link_button and link_video to wall.editAdsStealth
1dNDN Nov 11, 2023
826444c
update album_id in video.addToAlbum
1dNDN Nov 11, 2023
53f6ca1
add extended to friends.areFriends
1dNDN Nov 11, 2023
dcb1059
update target_uid in friends.getMutual
1dNDN Nov 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public void GetBotsLongPollHistory_BoardPostRestoreTest()

var expectedGroupId = new GroupId(1234);
const int unExpectedGroupId = -1234;
const int expectedUserId = 123;
const string expectedText = "test";

var botsLongPollHistory = Api.Groups.GetBotsLongPollHistory(new()
Expand Down
1 change: 0 additions & 1 deletion VkNet.Tests/Categories/Market/MarketGetTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using FluentAssertions;
using System.Reflection;
using VkNet.Tests.Infrastructure;
using Xunit;

Expand Down
7 changes: 7 additions & 0 deletions VkNet/Abstractions/Category/Async/IFriendsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ Task<ReadOnlyCollection<MutualFriend>> GetMutualAsync(FriendsGetMutualParams @pa
/// 0 – поле sign возвращать не нужно. флаг, может принимать значения 1 или 0
/// (Флаг, может принимать значения 1 или 0).
/// </param>
/// <param name="extended">
/// Информация о том, вернуть ли в ответе поле is_request_unread.
/// 1 – необходимо вернуть поле is_request_unread,
/// если есть непросмотренная заявка в друзья.
/// 0 — поле is_request_unread возвращать не нужно.
/// </param>
/// <param name="token">Токен отмены операции</param>
/// <returns>
/// После успешного выполнения возвращает массив объектов status, каждый из которых
Expand All @@ -128,6 +134,7 @@ Task<ReadOnlyCollection<MutualFriend>> GetMutualAsync(FriendsGetMutualParams @pa
/// </remarks>
Task<ReadOnlyCollection<AreFriendsResult>> AreFriendsAsync([NotNull] IEnumerable<long> userIds,
bool? needSign = null,
bool? extended = null,
CancellationToken token = default);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Abstractions/Category/IFriendsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface IFriendsCategory : IFriendsCategoryAsync
ReadOnlyCollection<MutualFriend> GetMutual(FriendsGetMutualParams @params);

/// <inheritdoc cref="IFriendsCategoryAsync.AreFriendsAsync" />
ReadOnlyCollection<AreFriendsResult> AreFriends([NotNull] IEnumerable<long> userIds, bool? needSign = null);
ReadOnlyCollection<AreFriendsResult> AreFriends([NotNull] IEnumerable<long> userIds, bool? needSign = null, bool? extended = null);

/// <inheritdoc cref="IFriendsCategoryAsync.AddListAsync" />
long AddList(string name, IEnumerable<long> userIds);
Expand Down
6 changes: 6 additions & 0 deletions VkNet/Categories/AdsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ public ReadOnlyCollection<Ad> GetAds(GetAdsParams getAdsParams) => _vk.Call<Read
{
"include_deleted", getAdsParams.IncludeDeleted
},
{
"only_deleted", getAdsParams.OnlyDeleted
},
{
"limit", getAdsParams.Limit
},
Expand Down Expand Up @@ -297,6 +300,9 @@ public ReadOnlyCollection<Layout> GetAdsLayout(GetAdsLayoutParams getAdsLayoutPa
{
"include_deleted", getAdsLayoutParams.IncludeDeleted
},
{
"only_deleted", getAdsLayoutParams.OnlyDeleted
},
{
"limit", getAdsLayoutParams.Limit
},
Expand Down
3 changes: 3 additions & 0 deletions VkNet/Categories/AppsCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public AppGetObject Get(AppGetParams @params, bool skipAuthorization = false)
{
return _vk.Call<AppGetObject>("apps.get", new()
{
{
"app_id", @params.AppId
},
{
"app_ids", @params.AppIds
},
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AccountCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.Filters;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AdsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AppWidgetsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.SafetyEnums;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AppsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.Filters;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AsrCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.StringEnums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AudioCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Enums.Filters;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/AuthCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/BoardCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/DatabaseCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/DocsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/FaveCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.StringEnums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/FaveCategoryAsyncObsolete.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
4 changes: 3 additions & 1 deletion VkNet/Categories/Async/FriendsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Enums.Filters;
using VkNet.Enums.StringEnums;
Expand Down Expand Up @@ -39,9 +40,10 @@ public Task<ReadOnlyCollection<MutualFriend>> GetMutualAsync(FriendsGetMutualPar
/// <inheritdoc />
public Task<ReadOnlyCollection<AreFriendsResult>> AreFriendsAsync(IEnumerable<long> userIds,
bool? needSign = null,
bool? extended = null,
CancellationToken token = default) =>
TypeHelper.TryInvokeMethodAsync(() =>
AreFriends(userIds, needSign), token);
AreFriends(userIds, needSign, extended), token);

/// <inheritdoc />
public Task<long> AddListAsync(string name,
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/GiftsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/GroupsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.Filters;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/LeadFormsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions.Category;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/LeadsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/LikesCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.StringEnums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 0 additions & 1 deletion VkNet/Categories/Async/MarketsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/NewsFeedCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.Filters;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/NotesCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/NotificationsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/OrdersCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.StringEnums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/PagesCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/PhotoCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/PlacesCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/PodcastsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/PollsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/PrettyCardsCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/SearchCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/SecureCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/StatusCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/StorageCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/StoriesCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/StreamingCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.StringEnums;
using VkNet.Model;
using VkNet.Utils;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/UsersCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums.Filters;
using VkNet.Enums.StringEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/UtilsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/VideoCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Enums.SafetyEnums;
using VkNet.Model;
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/WallCategoryAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Enums;
using VkNet.Enums.Filters;
using VkNet.Model;
Expand Down Expand Up @@ -56,7 +57,7 @@
long? groupId,
bool markAsAds,
CancellationToken token = default) =>
TypeHelper.TryInvokeMethodAsync(() =>

Check warning on line 60 in VkNet/Categories/Async/WallCategoryAsync.cs

View workflow job for this annotation

GitHub Actions / build

'WallCategory.Repost(string, string, long?, bool)' is obsolete: 'Use ICaptchaSolver to handle captcha. This method is obsolete and will be removed in future.'
Repost(@object, message, groupId, markAsAds), token);

/// <inheritdoc />
Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/Async/WidgetsCategoryAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
1 change: 1 addition & 0 deletions VkNet/Categories/FaveCategoryObsolete.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using VkNet.Abstractions;
using VkNet.Model;
using VkNet.Utils;

Expand Down
Loading
Loading