Skip to content

Commit

Permalink
Пометил StringEnums nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Panuchi committed Aug 16, 2023
1 parent a3efd52 commit 6d378ac
Show file tree
Hide file tree
Showing 101 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion VkNet.Tests/Categories/NewsFeed/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ public void Search_PostSourceData_Parsing()
var second = result.Items.Last();

second.PostSource.Data.Should()
.NotBe(null);
.Be(null);
}
}
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/Ad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class Ad
/// Рекламные площадки, на которых будет показываться объявление. (если значение применимо к данному формату объявления)
/// </summary>
[JsonProperty("ad_platform")]
public AdPlatform AdPlatform { get; set; }
public AdPlatform? AdPlatform { get; set; }

/// <summary>
/// 1 — для объявления задано ограничение «Не показывать на стенах сообществ».
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/AdEditSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class AdEditSpecification
/// Рекламные площадки, на которых будет показываться объявление. (если значение применимо к данному формату объявления)
/// </summary>
[JsonProperty("ad_platform")]
public AdPlatform AdPlatform { get; set; }
public AdPlatform? AdPlatform { get; set; }

/// <summary>
/// 1 — для объявления задано ограничение «Не показывать на стенах сообществ».
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/AdSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class AdSpecification
/// Рекламные площадки, на которых будет показываться объявление. (если значение применимо к данному формату объявления)
/// </summary>
[JsonProperty("ad_platform")]
public AdPlatform AdPlatform { get; set; }
public AdPlatform? AdPlatform { get; set; }

/// <summary>
/// 1 — для объявления задано ограничение «Не показывать на стенах сообществ».
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/AdsAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class AdsAccount
/// Тип рекламного кабинета.
/// </summary>
[JsonProperty(propertyName: "account_type")]
public AccountType AccountType { get; set; }
public AccountType? AccountType { get; set; }

/// <summary>
/// Cтатус рекламного кабинета.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/AdsCampaign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AdsCampaign
/// Тип кампании
/// </summary>
[JsonProperty(propertyName: "type")]
public CampaignType Type { get; set; }
public CampaignType? Type { get; set; }

/// <summary>
/// Название кампании
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/CampaignSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class CampaignSpecification
/// Формат объявления
/// </summary>
[JsonProperty("type")]
public CampaignType Type { get; set; }
public CampaignType? Type { get; set; }

/// <summary>
/// Название рекламной кампании.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/LinkStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class LinkStatus
/// Link status
/// </summary>
[JsonProperty("status")]
public LinkStatusType Status { get; set; }
public LinkStatusType? Status { get; set; }

/// <summary>
/// Reject reason
Expand Down
4 changes: 2 additions & 2 deletions VkNet/Model/Ads/LookalikeRequestsItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class LookalikeRequestItem
/// Тип источника исходной аудитории для поиска похожей аудитории.
/// </summary>
[JsonProperty("source_type")]
public SourceType SourceType { get; set; }
public SourceType? SourceType { get; set; }

/// <summary>
/// Время создания объявления
Expand All @@ -42,7 +42,7 @@ public class LookalikeRequestItem
/// Cтатус объявления.
/// </summary>
[JsonProperty(propertyName: "status")]
public AdRequestStatus Status { get; set; }
public AdRequestStatus? Status { get; set; }

/// <summary>
/// Дата запланированного удаления запроса.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/OfficeUsersAccesses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public class OfficeUsersAccesses
/// Время до следующего обновления в секундах.
/// </summary>
[JsonProperty("role")]
public AccessRole Role { get; set; }
public AccessRole? Role { get; set; }
}
2 changes: 1 addition & 1 deletion VkNet/Model/Ads/OfficeUsersSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class OfficeUsersSpecification
/// Тип полномочий.
/// </summary>
[JsonProperty("role")]
public AccessRole Role { get; set; }
public AccessRole? Role { get; set; }

/// <summary>
/// Массив идентификаторов клиента.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Attachments/AudioMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ public class AudioMessage : MediaAttachment
/// Статус транскрипции
/// </summary>
[JsonProperty("transcript_state")]
public TranscriptStates TranscriptState { get; set; }
public TranscriptStates? TranscriptState { get; set; }
}
2 changes: 1 addition & 1 deletion VkNet/Model/Attachments/AudioPlaylist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class AudioPlaylist : MediaAttachment
/// Тип плейлиста.
/// </summary>
[JsonProperty("album_type")]
public AudioAlbumType AlbumType { get; set; }
public AudioAlbumType? AlbumType { get; set; }

/// <summary>
/// Тип плейлиста.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Attachments/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class Post : MediaAttachment
/// чужой стены.
/// </summary>
[JsonProperty("post_type")]
public PostType PostType { get; set; }
public PostType? PostType { get; set; }

/// <summary>
/// Информация о способе размещения записи.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Attachments/Wall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class Wall : MediaAttachment
/// чужой стены.
/// </summary>
[JsonProperty("post_type")]
public PostType PostType { get; set; }
public PostType? PostType { get; set; }

/// <summary>
/// Информация о способе размещения записи.
Expand Down
4 changes: 2 additions & 2 deletions VkNet/Model/Audio/AudioCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class AudioCatalog
/// Тип каталога.
/// </summary>
[JsonProperty("type")]
public AudioCatalogType Type { get; set; }
public AudioCatalogType? Type { get; set; }

/// <summary>
/// Количество каталогов.
Expand All @@ -39,7 +39,7 @@ public class AudioCatalog
/// Источник каталога.
/// </summary>
[JsonProperty("source")]
public AudioCatalogSourceType Source { get; set; }
public AudioCatalogSourceType? Source { get; set; }

/// <summary>
/// Идентификатор каталога.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Audio/AudioCatalogItemMeta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ public class AudioCatalogItemMeta
/// Идентификатор владельца аудиозаписи.
/// </summary>
[JsonProperty("content_type")]
public UserOrGroupType ContentType { get; set; }
public UserOrGroupType? ContentType { get; set; }
}
2 changes: 1 addition & 1 deletion VkNet/Model/CallbackServerItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ public class CallbackServerItem
/// Статус сервера
/// </summary>
[JsonProperty(propertyName: "status")]
public CallbackServerStatus Status { get; set; }
public CallbackServerStatus? Status { get; set; }
}
2 changes: 1 addition & 1 deletion VkNet/Model/ClientInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ClientInfo
/// Массив кнопок, которые поддерживает клиент.
/// </summary>
[JsonProperty("button_actions")]
public KeyboardButtonActionType[] ButtonActions { get; set; }
public KeyboardButtonActionType?[] ButtonActions { get; set; }

/// <summary>
/// Поддерживается ли клавиатура ботов клиентом.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/ConversationChatSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ConversationChatSettings
/// Статус текущего пользователя.
/// </summary>
[JsonProperty("state")]
public ConversationChatSettingsState State { get; set; }
public ConversationChatSettingsState? State { get; set; }

/// <summary>
/// Изображение-обложка чата.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/EventData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class EventData
/// Тип действия, которые должно произойти после нажатия на кнопку
/// </summary>
[JsonProperty("type")]
public MessageEventType Type { get; set; }
public MessageEventType? Type { get; set; }

/// <summary>
/// текст, который нужно вывести (максимум 90 символов).
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Fave/FaveGetObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FaveGetObject
/// Тип объекта, добавленного в закладки.
/// </summary>
[JsonProperty("type")]
public FaveType Type { get; set; }
public FaveType? Type { get; set; }

/// <summary>
/// Массив меток объекта в списке закладок.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Fave/FaveGetPagesObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class FaveGetPagesObject
/// Тип страницы.
/// </summary>
[JsonProperty("type")]
public UserOrGroupType Type { get; set; }
public UserOrGroupType? Type { get; set; }

/// <summary>
/// Метки страницы.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/GroupUpdate/LikeAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class LikeAdd : IGroupUpdate
/// Тип материала.
/// </summary>
[JsonProperty("object_type")]
public LikeObjectType ObjectType { get; set; }
public LikeObjectType? ObjectType { get; set; }

/// <summary>
/// Идентификатор владельца материала.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/GroupUpdate/LikeRemove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class LikeRemove : IGroupUpdate
/// Тип материала.
/// </summary>
[JsonProperty("object_type")]
public LikeObjectType ObjectType { get; set; }
public LikeObjectType? ObjectType { get; set; }

/// <summary>
/// Идентификатор владельца материала.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Keyboard/AddButtonParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class AddButtonParams
/// <summary>
/// Цвет кнопки
/// </summary>
public KeyboardButtonColor Color { get; set; } = default;
public KeyboardButtonColor? Color { get; set; } = default;

/// <summary>
/// Основная информация о типе кнопки в Payload
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Keyboard/IKeyboardBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ IKeyboardBuilder AddButton(string label,
/// <param name="buttonAction">Действие при нажатии на кнопку</param>
/// <param name="color">Цвет кнопки</param>
/// <returns>Конструктор клавиатур</returns>
IKeyboardBuilder AddButton(MessageKeyboardButtonAction buttonAction, KeyboardButtonColor color = default);
IKeyboardBuilder AddButton(MessageKeyboardButtonAction buttonAction, KeyboardButtonColor? color = default);

/// <summary>
/// Добавить строку в клавиатуру
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Keyboard/KeyboardBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public KeyboardBuilder(string payloadType, bool isOneTime = false)
}

/// <inheritdoc />
public IKeyboardBuilder AddButton(MessageKeyboardButtonAction buttonAction, KeyboardButtonColor color = default)
public IKeyboardBuilder AddButton(MessageKeyboardButtonAction buttonAction, KeyboardButtonColor? color = default)
{
if (buttonAction.Payload is not null)
{
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/MessageActionObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MessageActionObject
/// Информация о сервисном действии с чатом.
/// </summary>
[JsonProperty("type")]
public MessageAction Type { get; set; }
public MessageAction? Type { get; set; }

/// <summary>
/// Идентификатор пользователя, которого пригласили или исключили
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/MessageContentSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MessageContentSource
/// Источник.
/// </summary>
[JsonProperty("type")]
public MessageContentSourceType Type { get; set; }
public MessageContentSourceType? Type { get; set; }

/// <summary>
/// От чьего имени указан peer_id. т.е. вы можете использовать контент из сообщения другой группы.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/NameRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class NameRequest
/// Статус заявки
/// </summary>
[JsonProperty("status")]
public ChangeNameStatus Status { get; set; }
public ChangeNameStatus? Status { get; set; }

/// <summary>
/// Дата, после которой возможна повторная подача заявки.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/NewsItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class NewsItem
/// Находится в записях со стен, содержит тип новости (post или copy).
/// </summary>
[JsonProperty("post_type")]
public PostTypeOrder PostType { get; set; }
public PostTypeOrder? PostType { get; set; }

/// <summary>
/// Передается в случае, если этот пост сделан при удалении.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/NewsSearchItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class NewsSearchItem
/// Тип записи
/// </summary>
[JsonProperty("post_type")]
public PostType PostType { get; set; }
public PostType? PostType { get; set; }

/// <summary>
/// Идентификатор записи при PostType == reply
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Occupation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public class Occupation
/// Информация о текущем роде занятия пользователя.
/// </summary>
[JsonProperty("type")]
public OccupationType Type { get; set; }
public OccupationType? Type { get; set; }
}
2 changes: 1 addition & 1 deletion VkNet/Model/OnlineStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class OnlineStatus
/// Статус
/// </summary>
[JsonProperty("status")]
public OnlineStatusType Status { get; set; }
public OnlineStatusType? Status { get; set; }

/// <summary>
/// Оценка времени ответа в минутах
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Peer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Peer
/// Тип.
/// </summary>
[JsonProperty("type")]
public ConversationPeerType Type { get; set; }
public ConversationPeerType? Type { get; set; }

/// <summary>
/// Локальный идентификатор назначения.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/PhotoSize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public class PhotoSize
/// Обозначение размера и пропорций копии.
/// </summary>
[JsonProperty("type")]
public PhotoSizeType Type { get; set; }
public PhotoSizeType? Type { get; set; }
}
2 changes: 1 addition & 1 deletion VkNet/Model/PollBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PollBackground
/// Тип фона.
/// </summary>
[JsonProperty("type")]
public PollBackgroundType Type { get; set; }
public PollBackgroundType? Type { get; set; }

/// <summary>
/// (для type = gradient) угол градиента по оси X.
Expand Down
6 changes: 3 additions & 3 deletions VkNet/Model/PostSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ public class PostSource
/// На данный момент поддерживаются следующие типы источников записи на стене.
/// </summary>
[JsonProperty("type")]
public PostSourceType Type { get; set; }
public PostSourceType? Type { get; set; }

/// <summary>
/// Название платформы, если оно доступно: android, iphone, wphone.
/// </summary>
[JsonProperty("platform", NullValueHandling = NullValueHandling.Ignore)]
public Platform Platform { get; set; }
public Platform? Platform { get; set; }

/// <summary>
/// Поле data является опциональным и содержит следующие данные в зависимости от
/// значения поля type:
/// </summary>
[JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)]
public PostSourceData Data { get; set; }
public PostSourceData? Data { get; set; }

/// <summary>
/// Cодержит внешнюю ссылку на ресурс, с которого была опубликована запись.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/Relative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Relative
/// Тип родственника (sibling и т.п.)
/// </summary>
[JsonProperty("type")]
public RelativeType Type { get; set; }
public RelativeType? Type { get; set; }

/// <summary>
/// Имя родственника, если он не является пользователем ВКонтакте.
Expand Down
2 changes: 1 addition & 1 deletion VkNet/Model/RequestParams/Ads/CheckLinkParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CheckLinkParams
/// Тип ссылки рекламы
/// </summary>
[JsonProperty(propertyName: "link_type")]
public AdsLinkType LinkType { get; set; }
public AdsLinkType? LinkType { get; set; }

/// <summary>
/// Ссылка
Expand Down
Loading

0 comments on commit 6d378ac

Please sign in to comment.