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

namespace MyTelegram.Schema;

///<summary>
/// This object contains information about an incoming shipping query.
/// See <a href="https://corefork.telegram.org/constructor/updateBotShippingQuery" />
///</summary>
[TlObject(0xb5aefd7d)]
public sealed class TUpdateBotShippingQuery : IUpdate
{
    public uint ConstructorId => 0xb5aefd7d;
    ///<summary>
    /// Unique query identifier
    ///</summary>
    public long QueryId { get; set; }

    ///<summary>
    /// User who sent the query
    ///</summary>
    public long UserId { get; set; }

    ///<summary>
    /// Bot specified invoice payload
    ///</summary>
    public ReadOnlyMemory<byte> Payload { get; set; }

    ///<summary>
    /// User specified shipping address
    /// See <a href="https://corefork.telegram.org/type/PostAddress" />
    ///</summary>
    public MyTelegram.Schema.IPostAddress ShippingAddress { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(QueryId);
        writer.Write(UserId);
        writer.Write(Payload);
        writer.Write(ShippingAddress);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        QueryId = buffer.ReadInt64();
        UserId = buffer.ReadInt64();
        Payload = buffer.ReadBytes();
        ShippingAddress = buffer.Read<MyTelegram.Schema.IPostAddress>();
    }
}