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

namespace MyTelegram.Schema;

///<summary>
/// Represents a location tag attached to a <a href="https://corefork.telegram.org/api/stories">story</a>, with additional venue information.
/// See <a href="https://corefork.telegram.org/constructor/mediaAreaVenue" />
///</summary>
[TlObject(0xbe82db9c)]
public sealed class TMediaAreaVenue : IMediaArea
{
    public uint ConstructorId => 0xbe82db9c;
    ///<summary>
    /// The size and location of the media area corresponding to the location sticker on top of the story media.
    /// See <a href="https://corefork.telegram.org/type/MediaAreaCoordinates" />
    ///</summary>
    public MyTelegram.Schema.IMediaAreaCoordinates Coordinates { get; set; }

    ///<summary>
    /// Coordinates of the 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" needs 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(Coordinates);
        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)
    {
        Coordinates = buffer.Read<MyTelegram.Schema.IMediaAreaCoordinates>();
        Geo = buffer.Read<MyTelegram.Schema.IGeoPoint>();
        Title = buffer.ReadString();
        Address = buffer.ReadString();
        Provider = buffer.ReadString();
        VenueId = buffer.ReadString();
        VenueType = buffer.ReadString();
    }
}