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

// PhotosDeletePhotosRequest represents TL type `photos.deletePhotos#87cf7f2f`.
// Deletes profile photos. The method returns a list of successfully deleted photo IDs.
//
// See https://core.telegram.org/method/photos.deletePhotos for reference.
type PhotosDeletePhotosRequest struct {
	// Input photos to delete
	ID []InputPhotoClass
}

// PhotosDeletePhotosRequestTypeID is TL type id of PhotosDeletePhotosRequest.
const PhotosDeletePhotosRequestTypeID = 0x87cf7f2f

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

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

	return true
}

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

// FillFrom fills PhotosDeletePhotosRequest from given interface.
func ( *PhotosDeletePhotosRequest) ( interface {
	() ( []InputPhotoClass)
}) {
	.ID = .()
}

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

// TypeName returns name of type in TL schema.
func (*PhotosDeletePhotosRequest) () string {
	return "photos.deletePhotos"
}

// TypeInfo returns info about TL type.
func ( *PhotosDeletePhotosRequest) () tdp.Type {
	 := tdp.Type{
		Name: "photos.deletePhotos",
		ID:   PhotosDeletePhotosRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PhotosDeletePhotosRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode photos.deletePhotos#87cf7f2f as nil")
	}
	.PutID(PhotosDeletePhotosRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PhotosDeletePhotosRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode photos.deletePhotos#87cf7f2f as nil")
	}
	.PutVectorHeader(len(.ID))
	for ,  := range .ID {
		if  == nil {
			return fmt.Errorf("unable to encode photos.deletePhotos#87cf7f2f: field id element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode photos.deletePhotos#87cf7f2f: field id element with index %d: %w", , )
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PhotosDeletePhotosRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode photos.deletePhotos#87cf7f2f to nil")
	}
	if  := .ConsumeID(PhotosDeletePhotosRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode photos.deletePhotos#87cf7f2f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhotosDeletePhotosRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode photos.deletePhotos#87cf7f2f to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode photos.deletePhotos#87cf7f2f: field id: %w", )
		}

		if  > 0 {
			.ID = make([]InputPhotoClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeInputPhoto()
			if  != nil {
				return fmt.Errorf("unable to decode photos.deletePhotos#87cf7f2f: field id: %w", )
			}
			.ID = append(.ID, )
		}
	}
	return nil
}

// GetID returns value of ID field.
func ( *PhotosDeletePhotosRequest) () ( []InputPhotoClass) {
	if  == nil {
		return
	}
	return .ID
}

// MapID returns field ID wrapped in InputPhotoClassArray helper.
func ( *PhotosDeletePhotosRequest) () ( InputPhotoClassArray) {
	return InputPhotoClassArray(.ID)
}

// PhotosDeletePhotos invokes method photos.deletePhotos#87cf7f2f returning error if any.
// Deletes profile photos. The method returns a list of successfully deleted photo IDs.
//
// See https://core.telegram.org/method/photos.deletePhotos for reference.
func ( *Client) ( context.Context,  []InputPhotoClass) ([]int64, error) {
	var  LongVector

	 := &PhotosDeletePhotosRequest{
		ID: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return []int64(.Elems), nil
}