// <auto-generated/>
// ReSharper disable All

namespace MyTelegram.Schema;

///<summary>
/// Used to download a server-generated image with the map preview from a <a href="https://corefork.telegram.org/constructor/geoPoint">geoPoint</a>, see the <a href="https://corefork.telegram.org/api/files#downloading-webfiles">webfile docs for more info »</a>.
/// See <a href="https://corefork.telegram.org/constructor/inputWebFileGeoPointLocation" />
///</summary>
[TlObject(0x9f2221c9)]
public sealed class TInputWebFileGeoPointLocation : IInputWebFileLocation
{
    public uint ConstructorId => 0x9f2221c9;
    ///<summary>
    /// Generated from the <code>lat</code>, <code>long</code> and <code>accuracy_radius</code> parameters of the <a href="https://corefork.telegram.org/constructor/geoPoint">geoPoint</a>
    /// See <a href="https://corefork.telegram.org/type/InputGeoPoint" />
    ///</summary>
    public MyTelegram.Schema.IInputGeoPoint GeoPoint { get; set; }

    ///<summary>
    /// Access hash of the <a href="https://corefork.telegram.org/constructor/geoPoint">geoPoint</a>
    ///</summary>
    public long AccessHash { get; set; }

    ///<summary>
    /// Map width in pixels before applying scale; 16-1024
    ///</summary>
    public int W { get; set; }

    ///<summary>
    /// Map height in pixels before applying scale; 16-1024
    ///</summary>
    public int H { get; set; }

    ///<summary>
    /// Map zoom level; 13-20
    ///</summary>
    public int Zoom { get; set; }

    ///<summary>
    /// Map scale; 1-3
    ///</summary>
    public int Scale { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(GeoPoint);
        writer.Write(AccessHash);
        writer.Write(W);
        writer.Write(H);
        writer.Write(Zoom);
        writer.Write(Scale);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        GeoPoint = buffer.Read<MyTelegram.Schema.IInputGeoPoint>();
        AccessHash = buffer.ReadInt64();
        W = buffer.ReadInt32();
        H = buffer.ReadInt32();
        Zoom = buffer.ReadInt32();
        Scale = buffer.ReadInt32();
    }
}