Skip to content

Commit

Permalink
Добавлены модели
Browse files Browse the repository at this point in the history
  • Loading branch information
K1llMan committed May 2, 2021
1 parent d3a8048 commit 4821554
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 12 deletions.
27 changes: 17 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@
# Данный GITIGNORE-файл был автоматически создан Microsoft(R) Visual Studio.
################################################################################

/Yandex.Music.Client.Tests/obj
/Yandex.Music.Client/obj
/Yandex.Music.Api.Tests/obj
/Yandex.Music.Api.sln.DotSettings.user
/.vs
/.vscode
/docs/build
/Yandex.Music.Api/bin
/Yandex.Music.Api/obj
/Yandex.Music.Api.Tests/bin/Debug/netcoreapp2.1
/Yandex.Music.Api/Yandex.Music.Api.csproj.user
/Yandex.Music.Api.Tests/bin
/Yandex.Music.Client.Tests/bin/Debug
/Yandex.Music.Client/bin/Debug
/docs/build
/.vscode
/Yandex.Music.Api.Tests/obj
/Yandex.Music.Client/bin
/Yandex.Music.Client/obj
/Yandex.Music.Client.Tests/bin
/Yandex.Music.Client.Tests/obj

/Yandex.Music.Api.sln.DotSettings.user
/Yandex.Music.Api/Yandex.Music.Api.csproj.user







1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Account/YAccountResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class YAccountResult
private YBar BarBelow2 {
set => BarBelow = value;
}
public string Userhash { get; set; }

#endregion
}
Expand Down
15 changes: 15 additions & 0 deletions Yandex.Music.Api/Models/Common/YPrice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Yandex.Music.Api.Models.Common
{
/// <summary>
/// Стоимость
/// </summary>
public class YPrice
{
#region Свойства

public decimal Amount { get; set; }
public string Currency { get; set; }

#endregion Свойства
}
}
25 changes: 25 additions & 0 deletions Yandex.Music.Api/Models/Common/YProduct.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Collections.Generic;

namespace Yandex.Music.Api.Models.Common
{
/// <summary>
/// Продукт
/// </summary>
public class YProduct
{
#region Свойства

public string ProductId { get; set; }
public YProductType Type { get; set; }
public string CommonPeriodDuration { get; set;}
public int Duration { get; set;}
public int TrialDuration { get; set;}
public YPrice Price { get; set; }
public bool Plus { get; set; }
public string Feature { get; set; }
public List<string> Features { get; set; }
public bool Debug { get; set; }

#endregion Свойства
}
}
13 changes: 13 additions & 0 deletions Yandex.Music.Api/Models/Common/YProductType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Yandex.Music.Api.Models.Common
{
/// <summary>
/// Тип продукта
/// </summary>
public enum YProductType
{
/// <summary>
/// Подписка
/// </summary>
Subscription
}
}
14 changes: 14 additions & 0 deletions Yandex.Music.Api/Models/Common/YReminder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Yandex.Music.Api.Models.Common
{
/// <summary>
/// Напоминание
/// </summary>
public class YReminder
{
#region Свойства

public int Days { get; set; }

#endregion Свойства
}
}
10 changes: 9 additions & 1 deletion Yandex.Music.Api/Models/Common/YSubscription.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
namespace Yandex.Music.Api.Models.Common
using System.Collections.Generic;

namespace Yandex.Music.Api.Models.Common
{
public class YSubscription
{
#region Свойства

public List<YSubscriptionService> AutoRenewable { get; set; }
public bool CanStartTrial { get; set; }
public bool HadAnySubscription { get; set; }
public bool McDonalds { get; set; }
public YPeriod NonAutoRenewable { get; set; }
public YReminder NonAutoRenewableRemainder { get; set; }

#endregion Свойства
}
}
22 changes: 22 additions & 0 deletions Yandex.Music.Api/Models/Common/YSubscriptionService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;

namespace Yandex.Music.Api.Models.Common
{
/// <summary>
/// Сервис подписки
/// </summary>
public class YSubscriptionService
{
#region Свойства

public DateTime Expires { get; set; }
public string Vendor { get; set; }
public string VendorHelpUrl { get; set; }
public string ProductId { get; set; }
public YProduct Product { get; set; }
public decimal OrderId { get; set; }
public bool Finished { get; set; }

#endregion Свойства
}
}
12 changes: 12 additions & 0 deletions Yandex.Music.Api/Models/Common/YTrackSharingFlag.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Runtime.Serialization;

namespace Yandex.Music.Api.Models.Common
{
public enum YTrackSharingFlag
{
[EnumMember(Value = "VIDEO_ALLOWED")]
VideoAllowed,
[EnumMember(Value = "COVER_ONLY")]
CoverOnly
}
}
2 changes: 2 additions & 0 deletions Yandex.Music.Api/Models/Search/Track/YSearchTrackModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;

using Yandex.Music.Api.Models.Common;
using Yandex.Music.Api.Models.Search.Album;
using Yandex.Music.Api.Models.Search.Artist;

Expand All @@ -24,6 +25,7 @@ public class YSearchTrackModel
public bool RememberPosition { get; set; }
public string StorageDir { get; set; }
public string Title { get; set; }
public YTrackSharingFlag TrackSharingFlag { get; set; }
public YSearchTrackType Type { get; set; }
public string Version { get; set; }

Expand Down
1 change: 1 addition & 0 deletions Yandex.Music.Api/Models/Track/YTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public YTrackAlbumPair GetKey()
public string StorageDir { get; set; }
public YTrack Substituted { get; set; }
public string Title { get; set; }
public YTrackSharingFlag TrackSharingFlag { get; set; }
public string Type { get; set; }
public string Version { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion Yandex.Music.Api/Yandex.Music.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<Content Include="..\README.md">
Expand Down

0 comments on commit 4821554

Please sign in to comment.