mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-05 06:26:44 +00:00
Generator Must Respect MS .NET API guidelines
This commit is contained in:
parent
3ba3ea53fd
commit
d769dd3c2f
646 changed files with 7213 additions and 7166 deletions
|
|
@ -18,62 +18,62 @@ namespace TeleSharp.TL.Payments
|
|||
}
|
||||
}
|
||||
|
||||
public int flags { get; set; }
|
||||
public bool can_save_credentials { get; set; }
|
||||
public bool password_missing { get; set; }
|
||||
public int bot_id { get; set; }
|
||||
public TLInvoice invoice { get; set; }
|
||||
public int provider_id { get; set; }
|
||||
public string url { get; set; }
|
||||
public string native_provider { get; set; }
|
||||
public TLDataJSON native_params { get; set; }
|
||||
public TLPaymentRequestedInfo saved_info { get; set; }
|
||||
public TLPaymentSavedCredentialsCard saved_credentials { get; set; }
|
||||
public TLVector<TLAbsUser> users { get; set; }
|
||||
public int Flags { get; set; }
|
||||
public bool CanSaveCredentials { get; set; }
|
||||
public bool PasswordMissing { get; set; }
|
||||
public int BotId { get; set; }
|
||||
public TLInvoice Invoice { get; set; }
|
||||
public int ProviderId { get; set; }
|
||||
public string Url { get; set; }
|
||||
public string NativeProvider { get; set; }
|
||||
public TLDataJSON NativeParams { get; set; }
|
||||
public TLPaymentRequestedInfo SavedInfo { get; set; }
|
||||
public TLPaymentSavedCredentialsCard SavedCredentials { get; set; }
|
||||
public TLVector<TLAbsUser> Users { get; set; }
|
||||
|
||||
|
||||
public void ComputeFlags()
|
||||
{
|
||||
flags = 0;
|
||||
flags = can_save_credentials ? (flags | 4) : (flags & ~4);
|
||||
flags = password_missing ? (flags | 8) : (flags & ~8);
|
||||
flags = native_provider != null ? (flags | 16) : (flags & ~16);
|
||||
flags = native_params != null ? (flags | 16) : (flags & ~16);
|
||||
flags = saved_info != null ? (flags | 1) : (flags & ~1);
|
||||
flags = saved_credentials != null ? (flags | 2) : (flags & ~2);
|
||||
Flags = 0;
|
||||
Flags = CanSaveCredentials ? (Flags | 4) : (Flags & ~4);
|
||||
Flags = PasswordMissing ? (Flags | 8) : (Flags & ~8);
|
||||
Flags = NativeProvider != null ? (Flags | 16) : (Flags & ~16);
|
||||
Flags = NativeParams != null ? (Flags | 16) : (Flags & ~16);
|
||||
Flags = SavedInfo != null ? (Flags | 1) : (Flags & ~1);
|
||||
Flags = SavedCredentials != null ? (Flags | 2) : (Flags & ~2);
|
||||
|
||||
}
|
||||
|
||||
public override void DeserializeBody(BinaryReader br)
|
||||
{
|
||||
flags = br.ReadInt32();
|
||||
can_save_credentials = (flags & 4) != 0;
|
||||
password_missing = (flags & 8) != 0;
|
||||
bot_id = br.ReadInt32();
|
||||
invoice = (TLInvoice)ObjectUtils.DeserializeObject(br);
|
||||
provider_id = br.ReadInt32();
|
||||
url = StringUtil.Deserialize(br);
|
||||
if ((flags & 16) != 0)
|
||||
native_provider = StringUtil.Deserialize(br);
|
||||
Flags = br.ReadInt32();
|
||||
CanSaveCredentials = (Flags & 4) != 0;
|
||||
PasswordMissing = (Flags & 8) != 0;
|
||||
BotId = br.ReadInt32();
|
||||
Invoice = (TLInvoice)ObjectUtils.DeserializeObject(br);
|
||||
ProviderId = br.ReadInt32();
|
||||
Url = StringUtil.Deserialize(br);
|
||||
if ((Flags & 16) != 0)
|
||||
NativeProvider = StringUtil.Deserialize(br);
|
||||
else
|
||||
native_provider = null;
|
||||
NativeProvider = null;
|
||||
|
||||
if ((flags & 16) != 0)
|
||||
native_params = (TLDataJSON)ObjectUtils.DeserializeObject(br);
|
||||
if ((Flags & 16) != 0)
|
||||
NativeParams = (TLDataJSON)ObjectUtils.DeserializeObject(br);
|
||||
else
|
||||
native_params = null;
|
||||
NativeParams = null;
|
||||
|
||||
if ((flags & 1) != 0)
|
||||
saved_info = (TLPaymentRequestedInfo)ObjectUtils.DeserializeObject(br);
|
||||
if ((Flags & 1) != 0)
|
||||
SavedInfo = (TLPaymentRequestedInfo)ObjectUtils.DeserializeObject(br);
|
||||
else
|
||||
saved_info = null;
|
||||
SavedInfo = null;
|
||||
|
||||
if ((flags & 2) != 0)
|
||||
saved_credentials = (TLPaymentSavedCredentialsCard)ObjectUtils.DeserializeObject(br);
|
||||
if ((Flags & 2) != 0)
|
||||
SavedCredentials = (TLPaymentSavedCredentialsCard)ObjectUtils.DeserializeObject(br);
|
||||
else
|
||||
saved_credentials = null;
|
||||
SavedCredentials = null;
|
||||
|
||||
users = (TLVector<TLAbsUser>)ObjectUtils.DeserializeVector<TLAbsUser>(br);
|
||||
Users = (TLVector<TLAbsUser>)ObjectUtils.DeserializeVector<TLAbsUser>(br);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -81,22 +81,22 @@ namespace TeleSharp.TL.Payments
|
|||
{
|
||||
bw.Write(Constructor);
|
||||
ComputeFlags();
|
||||
bw.Write(flags);
|
||||
bw.Write(Flags);
|
||||
|
||||
|
||||
bw.Write(bot_id);
|
||||
ObjectUtils.SerializeObject(invoice, bw);
|
||||
bw.Write(provider_id);
|
||||
StringUtil.Serialize(url, bw);
|
||||
if ((flags & 16) != 0)
|
||||
StringUtil.Serialize(native_provider, bw);
|
||||
if ((flags & 16) != 0)
|
||||
ObjectUtils.SerializeObject(native_params, bw);
|
||||
if ((flags & 1) != 0)
|
||||
ObjectUtils.SerializeObject(saved_info, bw);
|
||||
if ((flags & 2) != 0)
|
||||
ObjectUtils.SerializeObject(saved_credentials, bw);
|
||||
ObjectUtils.SerializeObject(users, bw);
|
||||
bw.Write(BotId);
|
||||
ObjectUtils.SerializeObject(Invoice, bw);
|
||||
bw.Write(ProviderId);
|
||||
StringUtil.Serialize(Url, bw);
|
||||
if ((Flags & 16) != 0)
|
||||
StringUtil.Serialize(NativeProvider, bw);
|
||||
if ((Flags & 16) != 0)
|
||||
ObjectUtils.SerializeObject(NativeParams, bw);
|
||||
if ((Flags & 1) != 0)
|
||||
ObjectUtils.SerializeObject(SavedInfo, bw);
|
||||
if ((Flags & 2) != 0)
|
||||
ObjectUtils.SerializeObject(SavedCredentials, bw);
|
||||
ObjectUtils.SerializeObject(Users, bw);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue