-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Актуализированы модели авторизации (#19)
* Actualize authorization models Return of authorization methods changed from (bool) to (YAuthBase and its childs) * Fix AuthorizeByCaptcha return * Reaction to #19
- Loading branch information
Showing
10 changed files
with
101 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Yandex.Music.Api.Models.Account | ||
{ | ||
public class YAuthCaptcha : YAuthBase | ||
{ | ||
public string Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public string Label { get; set; } | ||
|
||
public string Mode { get; set; } | ||
|
||
public List<YAuthCaptchaError> Error { get; set; } | ||
|
||
public bool CountryFromAudioWhiteList { get; set; } | ||
|
||
public YAuthCaptchaOptions Options { get; set; } | ||
|
||
public YAuthCaptchaVoice Voice { get; set; } | ||
|
||
[JsonProperty("image_url")] | ||
public string ImageUrl { get; set; } | ||
|
||
public string Key { get; set; } | ||
|
||
public YAuthCaptchaVoice Voice { get; set; } | ||
public string Static { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Yandex.Music.Api.Models.Account | ||
{ | ||
public class YAuthCaptchaError | ||
{ | ||
public string Message { get; set; } | ||
public YAuthCaptchaErrorCode Code { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Yandex.Music.Api.Models.Account | ||
{ | ||
public enum YAuthCaptchaErrorCode | ||
{ | ||
MissingValue, | ||
CaptchaLocate, | ||
Incorrect | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Yandex.Music.Api.Models.Account | ||
{ | ||
public class YAuthCaptchaOptions | ||
{ | ||
public bool AsyncCheck { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Yandex.Music.Api.Models.Account | ||
{ | ||
public enum YAuthError | ||
{ | ||
[EnumMember(Value = "authorization.invalid")] | ||
AuthorizationInvalid, | ||
[EnumMember(Value = "sessionid.invalid")] | ||
SessionIdInvalid, | ||
[EnumMember(Value = "password.not_matched")] | ||
PasswordNotMatched, | ||
[EnumMember(Value = "password.empty")] | ||
PasswordEmpty, | ||
[EnumMember(Value = "captcha.required")] | ||
CaptchaRequired, | ||
[EnumMember(Value = "captcha.not_matched")] | ||
CaptchaNotMatched | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
{ | ||
public enum YAuthStatus | ||
{ | ||
Ok | ||
Ok, | ||
Error | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters