// 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{}
)

// MessagesSendScreenshotNotificationRequest represents TL type `messages.sendScreenshotNotification#a1405817`.
// Notify the other user in a private chat that a screenshot of the chat was taken
//
// See https://core.telegram.org/method/messages.sendScreenshotNotification for reference.
type MessagesSendScreenshotNotificationRequest struct {
	// Other user
	Peer InputPeerClass
	// Indicates the message that was screenshotted (the specified message ID can also be 0
	// to avoid indicating any specific message).
	ReplyTo InputReplyToClass
	// Random ID to avoid message resending
	RandomID int64
}

// MessagesSendScreenshotNotificationRequestTypeID is TL type id of MessagesSendScreenshotNotificationRequest.
const MessagesSendScreenshotNotificationRequestTypeID = 0xa1405817

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

func ( *MessagesSendScreenshotNotificationRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.ReplyTo == nil) {
		return false
	}
	if !(.RandomID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesSendScreenshotNotificationRequest from given interface.
func ( *MessagesSendScreenshotNotificationRequest) ( interface {
	() ( InputPeerClass)
	() ( InputReplyToClass)
	() ( int64)
}) {
	.Peer = .()
	.ReplyTo = .()
	.RandomID = .()
}

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

// TypeName returns name of type in TL schema.
func (*MessagesSendScreenshotNotificationRequest) () string {
	return "messages.sendScreenshotNotification"
}

// TypeInfo returns info about TL type.
func ( *MessagesSendScreenshotNotificationRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.sendScreenshotNotification",
		ID:   MessagesSendScreenshotNotificationRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "ReplyTo",
			SchemaName: "reply_to",
		},
		{
			Name:       "RandomID",
			SchemaName: "random_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesSendScreenshotNotificationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.sendScreenshotNotification#a1405817 as nil")
	}
	.PutID(MessagesSendScreenshotNotificationRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesSendScreenshotNotificationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.sendScreenshotNotification#a1405817 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.sendScreenshotNotification#a1405817: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.sendScreenshotNotification#a1405817: field peer: %w", )
	}
	if .ReplyTo == nil {
		return fmt.Errorf("unable to encode messages.sendScreenshotNotification#a1405817: field reply_to is nil")
	}
	if  := .ReplyTo.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.sendScreenshotNotification#a1405817: field reply_to: %w", )
	}
	.PutLong(.RandomID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesSendScreenshotNotificationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.sendScreenshotNotification#a1405817 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendScreenshotNotification#a1405817: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeInputReplyTo()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendScreenshotNotification#a1405817: field reply_to: %w", )
		}
		.ReplyTo = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendScreenshotNotification#a1405817: field random_id: %w", )
		}
		.RandomID = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *MessagesSendScreenshotNotificationRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetReplyTo returns value of ReplyTo field.
func ( *MessagesSendScreenshotNotificationRequest) () ( InputReplyToClass) {
	if  == nil {
		return
	}
	return .ReplyTo
}

// GetRandomID returns value of RandomID field.
func ( *MessagesSendScreenshotNotificationRequest) () ( int64) {
	if  == nil {
		return
	}
	return .RandomID
}

// MessagesSendScreenshotNotification invokes method messages.sendScreenshotNotification#a1405817 returning error if any.
// Notify the other user in a private chat that a screenshot of the chat was taken
//
// Possible errors:
//
//	400 INPUT_USER_DEACTIVATED: The specified user was deleted.
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//	400 STORY_ID_INVALID: The specified story ID is invalid.
//	400 YOU_BLOCKED_USER: You blocked this user.
//
// See https://core.telegram.org/method/messages.sendScreenshotNotification for reference.
func ( *Client) ( context.Context,  *MessagesSendScreenshotNotificationRequest) (UpdatesClass, error) {
	var  UpdatesBox

	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .Updates, nil
}