-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add localization, optimization, better error handling
- Loading branch information
Showing
19 changed files
with
649 additions
and
208 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
bin/ | ||
obj/ | ||
.idea | ||
.idea | ||
.DS_Store | ||
*.DotSettings.user |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace YandexKeyExtractor.Exceptions; | ||
|
||
public class InvalidTrackIdException : Exception | ||
{ | ||
public InvalidTrackIdException() : base("Invalid track ID.") | ||
{ | ||
} | ||
} |
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,10 @@ | ||
using System; | ||
|
||
namespace YandexKeyExtractor.Exceptions; | ||
|
||
public class NoValidBackupException : Exception | ||
{ | ||
public NoValidBackupException() : base(Localization.NoValidBackup) | ||
{ | ||
} | ||
} |
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,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace YandexKeyExtractor.Exceptions; | ||
|
||
public class ResponseFailedException : Exception | ||
{ | ||
public string ResponseName { get; } | ||
public string? Status { get; } | ||
public IReadOnlyCollection<string>? Errors { get; } | ||
|
||
public ResponseFailedException(string responseName) : base($"{responseName} failed.") | ||
{ | ||
ResponseName = responseName; | ||
} | ||
|
||
public ResponseFailedException(string responseName, string? status, IReadOnlyCollection<string>? errors) : this(responseName) | ||
{ | ||
Status = status; | ||
Errors = errors; | ||
} | ||
} |
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,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace YandexKeyExtractor.Models; | ||
|
||
public class BackupInfo | ||
{ | ||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] | ||
[JsonPropertyName("updated")] | ||
public uint Updated { 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
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,9 +1,10 @@ | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace YandexKeyExtractor.Models; | ||
|
||
public class CountryResponse : StatusResponse | ||
{ | ||
[JsonPropertyName("country")] | ||
public string[]? Country { get; set; } | ||
public IReadOnlyCollection<string>? Country { 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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace YandexKeyExtractor.Models; | ||
|
||
public class PhoneNumberInfo | ||
{ | ||
[JsonPropertyName("e164")] | ||
public string? StandardizedNumber { 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
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,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace YandexKeyExtractor.Models; | ||
|
||
[JsonSerializable(typeof(BackupInfoResponse))] | ||
[JsonSerializable(typeof(BackupResponse))] | ||
[JsonSerializable(typeof(CountryResponse))] | ||
[JsonSerializable(typeof(PhoneNumberResponse))] | ||
[JsonSerializable(typeof(StatusResponse))] | ||
[JsonSerializable(typeof(TrackResponse))] | ||
[JsonSourceGenerationOptions(DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] | ||
public partial class SourceGenerationContext : JsonSerializerContext | ||
{ | ||
} |
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
Oops, something went wrong.