// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// ReceivedNotifyMessage represents TL type `receivedNotifyMessage#a384b779`.
// Message ID, for which PUSH-notifications were cancelled.
//
// See https://core.telegram.org/constructor/receivedNotifyMessage for reference.
type ReceivedNotifyMessage struct {
	// Message ID, for which PUSH-notifications were canceled
	ID int
	// Reserved for future use
	Flags int
}

// ReceivedNotifyMessageTypeID is TL type id of ReceivedNotifyMessage.
const ReceivedNotifyMessageTypeID = 0xa384b779

// Ensuring interfaces in compile-time for ReceivedNotifyMessage.
var (
	_ bin.Encoder     = &ReceivedNotifyMessage{}
	_ bin.Decoder     = &ReceivedNotifyMessage{}
	_ bin.BareEncoder = &ReceivedNotifyMessage{}
	_ bin.BareDecoder = &ReceivedNotifyMessage{}
)

func ( *ReceivedNotifyMessage) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Flags == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *ReceivedNotifyMessage) () string {
	if  == nil {
		return "ReceivedNotifyMessage(nil)"
	}
	type  ReceivedNotifyMessage
	return fmt.Sprintf("ReceivedNotifyMessage%+v", (*))
}

// FillFrom fills ReceivedNotifyMessage from given interface.
func ( *ReceivedNotifyMessage) ( interface {
	() ( int)
	() ( int)
}) {
	.ID = .()
	.Flags = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*ReceivedNotifyMessage) () uint32 {
	return ReceivedNotifyMessageTypeID
}

// TypeName returns name of type in TL schema.
func (*ReceivedNotifyMessage) () string {
	return "receivedNotifyMessage"
}

// TypeInfo returns info about TL type.
func ( *ReceivedNotifyMessage) () tdp.Type {
	 := tdp.Type{
		Name: "receivedNotifyMessage",
		ID:   ReceivedNotifyMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Flags",
			SchemaName: "flags",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ReceivedNotifyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode receivedNotifyMessage#a384b779 as nil")
	}
	.PutID(ReceivedNotifyMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReceivedNotifyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode receivedNotifyMessage#a384b779 as nil")
	}
	.PutInt(.ID)
	.PutInt(.Flags)
	return nil
}

// Decode implements bin.Decoder.
func ( *ReceivedNotifyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode receivedNotifyMessage#a384b779 to nil")
	}
	if  := .ConsumeID(ReceivedNotifyMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode receivedNotifyMessage#a384b779: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *ReceivedNotifyMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode receivedNotifyMessage#a384b779 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode receivedNotifyMessage#a384b779: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode receivedNotifyMessage#a384b779: field flags: %w", )
		}
		.Flags = 
	}
	return nil
}

// GetID returns value of ID field.
func ( *ReceivedNotifyMessage) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// GetFlags returns value of Flags field.
func ( *ReceivedNotifyMessage) () ( int) {
	if  == nil {
		return
	}
	return .Flags
}