Skip to content

Commit

Permalink
Обновлены модели
Browse files Browse the repository at this point in the history
  • Loading branch information
K1llMan committed Jan 12, 2023
1 parent aed899e commit a4da66e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/Yandex.Music.Api/Common/AuthStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class AuthStorage
public IRequestProvider Provider { get; }

/// <summary>
/// Gets or sets the access token.
/// Токен доступа
/// </summary>
public YAccessToken AccessToken { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions src/Yandex.Music.Api/Models/Account/YAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

using Newtonsoft.Json;

using Yandex.Music.Api.Models.Common;

namespace Yandex.Music.Api.Models.Account
{
public class YAccount
Expand Down
3 changes: 3 additions & 0 deletions src/Yandex.Music.Api/Models/Account/YAccountResult.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Collections.Generic;

using Newtonsoft.Json;

using Yandex.Music.Api.Models.Common;
Expand All @@ -8,6 +10,7 @@ public class YAccountResult
{
public YAccount Account { get; set; }
public string DefaultEmail { get; set; }
public List<string> HasOptions { get; set; }
public YMasterHub MasterHub { get; set; }
public YPermissions Permissions { get; set; }
public YPlus Plus { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Yandex.Music.Api/Models/Account/YAuthTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class YAuthTypes : YAuthBase
public string Country { get; set; }

[JsonProperty("phone_number")]
public YPhone PhoneNumber { get; set; }
public YPhoneNumber PhoneNumberNumber { get; set; }

[JsonProperty("magic_link_email")]
public string MagicLinkEmail { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using Newtonsoft.Json;

namespace Yandex.Music.Api.Models.Account
{
public class YPhone
{
[JsonProperty("masked_e164")]
public string MaskedE164 { get; set; }

public string E164 { get; set; }

public string International { get; set; }

[JsonProperty("masked_original")]
public string MaskedOriginal { get; set; }

public string Original { get; set; }

[JsonProperty("masked_international")]
public string MaskedInternational { get; set; }
}
using Newtonsoft.Json;

namespace Yandex.Music.Api.Models.Account
{
public class YPhoneNumber
{
[JsonProperty("masked_e164")]
public string MaskedE164 { get; set; }

public string E164 { get; set; }

public string International { get; set; }

[JsonProperty("masked_original")]
public string MaskedOriginal { get; set; }

public string Original { get; set; }

[JsonProperty("masked_international")]
public string MaskedInternational { get; set; }
}
}
4 changes: 4 additions & 0 deletions src/Yandex.Music.Api/Models/Feed/Event/YFeedEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ private YFeedEvent GetEvent(JToken jObject)
feedEvent = jObject.ToObject<YFeedEventGenreTracksTop>();
break;

case YFeedEventType.NewAlbums:
feedEvent = jObject.ToObject<YFeedEventAlbums>();
break;

case YFeedEventType.NewAlbumsOfFavoriteGenre:
feedEvent = jObject.ToObject<YFeedEventGenreAlbums>();
break;
Expand Down
11 changes: 11 additions & 0 deletions src/Yandex.Music.Api/Models/Feed/Event/YFeedEventAlbums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;

using Yandex.Music.Api.Models.Album;

namespace Yandex.Music.Api.Models.Feed.Event
{
public class YFeedEventAlbums: YFeedEvent
{
public List<YAlbum> Albums { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using System.Collections.Generic;

using Yandex.Music.Api.Models.Album;

namespace Yandex.Music.Api.Models.Feed.Event
namespace Yandex.Music.Api.Models.Feed.Event
{
public class YFeedEventGenreAlbums: YFeedEvent
public class YFeedEventGenreAlbums: YFeedEventAlbums
{
public string Genre { get; set; }
public List<YAlbum> Albums { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/Yandex.Music.Api/Models/Feed/Event/YFeedEventType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public enum YFeedEventType
[EnumMember(Value = "missed-tracks-by-artist")]
MissedTracksByArtist,

[EnumMember(Value = "new-albums")]
NewAlbums,

[EnumMember(Value = "new-albums-of-favorite-genre")]
NewAlbumsOfFavoriteGenre,

Expand Down

0 comments on commit a4da66e

Please sign in to comment.