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

namespace MyTelegram.Schema;

///<summary>
/// Venue
/// See <a href="https://corefork.telegram.org/constructor/messageMediaVenue" />
///</summary>
[TlObject(0x2ec0533f)]
public sealed class TMessageMediaVenue : IMessageMedia
{
    public uint ConstructorId => 0x2ec0533f;
    ///<summary>
    /// Geolocation of venue
    /// See <a href="https://corefork.telegram.org/type/GeoPoint" />
    ///</summary>
    public MyTelegram.Schema.IGeoPoint Geo { get; set; }

    ///<summary>
    /// Venue name
    ///</summary>
    public string Title { get; set; }

    ///<summary>
    /// Address
    ///</summary>
    public string Address { get; set; }

    ///<summary>
    /// Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be supported
    ///</summary>
    public string Provider { get; set; }

    ///<summary>
    /// Venue ID in the provider's database
    ///</summary>
    public string VenueId { get; set; }

    ///<summary>
    /// Venue type in the provider's database
    ///</summary>
    public string VenueType { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Geo);
        writer.Write(Title);
        writer.Write(Address);
        writer.Write(Provider);
        writer.Write(VenueId);
        writer.Write(VenueType);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Geo = buffer.Read<MyTelegram.Schema.IGeoPoint>();
        Title = buffer.ReadString();
        Address = buffer.ReadString();
        Provider = buffer.ReadString();
        VenueId = buffer.ReadString();
        VenueType = buffer.ReadString();
    }
}