-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix receiving bug with try-catch, and add registeration api type classes. #27
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace TdLib | ||
{ | ||
/// <summary> | ||
/// Autogenerated TDLib APIs | ||
/// </summary> | ||
public partial class TdApi | ||
{ | ||
/// <summary> | ||
/// Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode | ||
/// </summary> | ||
public class RegisterUser : Function<Ok> | ||
{ | ||
/// <summary> | ||
/// Data type for serialization | ||
/// </summary> | ||
[JsonProperty("@type")] | ||
public override string DataType { get; set; } = "registerUser"; | ||
|
||
/// <summary> | ||
/// Extra data attached to the message | ||
/// </summary> | ||
[JsonProperty("@extra")] | ||
public override string Extra { get; set; } | ||
|
||
/// <summary> | ||
/// If the user is not yet registered, the first name of the user; 1-64 characters. You can also pass an empty string for unregistered user there to check verification code validness. In the latter case PHONE_NUMBER_UNOCCUPIED error will be returned for a valid code | ||
/// </summary> | ||
[JsonConverter(typeof(Converter))] | ||
[JsonProperty("first_name")] | ||
public string FirstName { get; set; } | ||
|
||
/// <summary> | ||
/// If the user is not yet registered; the last name of the user; optional; 0-64 characters | ||
/// </summary> | ||
[JsonConverter(typeof(Converter))] | ||
[JsonProperty("last_name")] | ||
public string LastName { 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
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,42 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace TdLib | ||
{ | ||
/// <summary> | ||
/// Autogenerated TDLib APIs | ||
/// </summary> | ||
public partial class TdApi | ||
{ | ||
/// <summary> | ||
/// TDLib needs the user's authentication code to finalize authorization | ||
/// </summary> | ||
public partial class AuthorizationState : Object | ||
{ | ||
/// <summary> | ||
/// TDLib needs the user's authentication code to finalize authorization | ||
/// </summary> | ||
public class AuthorizationStateWaitRegistration : AuthorizationState | ||
{ | ||
/// <summary> | ||
/// Data type for serialization | ||
/// </summary> | ||
[JsonProperty("@type")] | ||
public override string DataType { get; set; } = "authorizationStateWaitRegistration"; | ||
|
||
/// <summary> | ||
/// Extra data attached to the message | ||
/// </summary> | ||
[JsonProperty("@extra")] | ||
public override string Extra { get; set; } | ||
|
||
/// <summary> | ||
/// Information about the authorization code that was sent | ||
/// </summary> | ||
[JsonConverter(typeof(Converter))] | ||
[JsonProperty("terms_of_service")] | ||
public TermsOfService TermsOfService { 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,50 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace TdLib | ||
{ | ||
/// <summary> | ||
/// Autogenerated TDLib APIs | ||
/// </summary> | ||
public partial class TdApi | ||
{ | ||
/// <summary> | ||
/// A personal document, containing some information about a user | ||
/// </summary> | ||
public class PhoneNumberAuthenticationSettings : Object | ||
{ | ||
/// <summary> | ||
/// Data type for serialization | ||
/// </summary> | ||
[JsonProperty("@type")] | ||
public override string DataType { get; set; } = "phoneNumberAuthenticationSettings"; | ||
|
||
/// <summary> | ||
/// Extra data attached to the message | ||
/// </summary> | ||
[JsonProperty("@extra")] | ||
public override string Extra { get; set; } | ||
|
||
/// <summary> | ||
/// Pass true if the authentication code may be sent via flash call to the specified phone number | ||
/// </summary> | ||
[JsonConverter(typeof(Converter))] | ||
[JsonProperty("allow_flash_call")] | ||
public bool AllowFlashCall { get; set; } | ||
|
||
/// <summary> | ||
/// Pass true if the phone number is used on the current device. Ignored if allow_flash_call is false | ||
/// </summary> | ||
[JsonConverter(typeof(Converter))] | ||
[JsonProperty("is_current_phone_number")] | ||
public bool IsCurrentPhoneNumber { get; set; } | ||
|
||
/// <summary> | ||
/// For official applications only. True, if the app can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details. | ||
/// </summary> | ||
[JsonConverter(typeof(Converter))] | ||
[JsonProperty("allow_sms_retriever_api")] | ||
public bool AllowSmsRetrieverApi { 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,16 @@ | ||
using System; | ||
|
||
namespace TdLib | ||
{ | ||
public class TdApiNotFoundException : Exception | ||
{ | ||
public readonly string ApiName; | ||
|
||
public TdApiNotFoundException(string apiName) : this(apiName, null) | ||
{ | ||
this.ApiName = apiName; | ||
} | ||
|
||
public TdApiNotFoundException(string apiName, Exception innerException) : base($"{apiName} Not found. Maybe your TdDLib.Api is outdated.", innerException) { } | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think printing to Console from the library is a good solution. Maybe event would fit better in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.