TLSharp/TeleSharp.TL/TL/TLBotInlineResult.cs
AdmAlexus 6c7ec7f91a Fix V3029 warnings from PVS-Studio Static Analyzer
Warnings with low priority:

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 69, 71.
TLPasswordInputSettings.cs 69

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 71, 73.
TLPasswordInputSettings.cs 71

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 91, 93.
TLPaymentForm.cs 91

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 120, 122.
TLBotInlineResult.cs 120

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 124, 126.
TLBotInlineResult.cs 124

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 124, 126.
TLChannelFull.cs 124

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 120, 122.
TLInputBotInlineResult.cs 120

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 124, 126.
TLInputBotInlineResult.cs 124

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 154, 156. TLWebPage.cs
154

V3029 The conditional expressions of the 'if' statements situated
alongside each other are identical. Check lines: 158, 160. TLWebPage.cs
158
2017-10-29 19:45:52 +05:00

137 lines
4.1 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeleSharp.TL;
namespace TeleSharp.TL
{
[TLObject(-1679053127)]
public class TLBotInlineResult : TLAbsBotInlineResult
{
public override int Constructor
{
get
{
return -1679053127;
}
}
public int flags { get; set; }
public string id { get; set; }
public string type { get; set; }
public string title { get; set; }
public string description { get; set; }
public string url { get; set; }
public string thumb_url { get; set; }
public string content_url { get; set; }
public string content_type { get; set; }
public int? w { get; set; }
public int? h { get; set; }
public int? duration { get; set; }
public TLAbsBotInlineMessage send_message { get; set; }
public void ComputeFlags()
{
flags = 0;
flags = title != null ? (flags | 2) : (flags & ~2);
flags = description != null ? (flags | 4) : (flags & ~4);
flags = url != null ? (flags | 8) : (flags & ~8);
flags = thumb_url != null ? (flags | 16) : (flags & ~16);
flags = content_url != null ? (flags | 32) : (flags & ~32);
flags = content_type != null ? (flags | 32) : (flags & ~32);
flags = w != null ? (flags | 64) : (flags & ~64);
flags = h != null ? (flags | 64) : (flags & ~64);
flags = duration != null ? (flags | 128) : (flags & ~128);
}
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
id = StringUtil.Deserialize(br);
type = StringUtil.Deserialize(br);
if ((flags & 2) != 0)
title = StringUtil.Deserialize(br);
else
title = null;
if ((flags & 4) != 0)
description = StringUtil.Deserialize(br);
else
description = null;
if ((flags & 8) != 0)
url = StringUtil.Deserialize(br);
else
url = null;
if ((flags & 16) != 0)
thumb_url = StringUtil.Deserialize(br);
else
thumb_url = null;
if ((flags & 32) != 0)
content_url = StringUtil.Deserialize(br);
else
content_url = null;
if ((flags & 32) != 0)
content_type = StringUtil.Deserialize(br);
else
content_type = null;
if ((flags & 64) != 0)
w = br.ReadInt32();
else
w = null;
if ((flags & 64) != 0)
h = br.ReadInt32();
else
h = null;
if ((flags & 128) != 0)
duration = br.ReadInt32();
else
duration = null;
send_message = (TLAbsBotInlineMessage)ObjectUtils.DeserializeObject(br);
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
ComputeFlags();
bw.Write(flags);
StringUtil.Serialize(id, bw);
StringUtil.Serialize(type, bw);
if ((flags & 2) != 0)
StringUtil.Serialize(title, bw);
if ((flags & 4) != 0)
StringUtil.Serialize(description, bw);
if ((flags & 8) != 0)
StringUtil.Serialize(url, bw);
if ((flags & 16) != 0)
StringUtil.Serialize(thumb_url, bw);
if ((flags & 32) != 0)
{
StringUtil.Serialize(content_url, bw);
StringUtil.Serialize(content_type, bw);
}
if ((flags & 64) != 0)
{
bw.Write(w.Value);
bw.Write(h.Value);
}
if ((flags & 128) != 0)
bw.Write(duration.Value);
ObjectUtils.SerializeObject(send_message, bw);
}
}
}