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

// AccountReportProfilePhotoRequest represents TL type `account.reportProfilePhoto#fa8cc6f5`.
// Report a profile photo of a dialog
//
// See https://core.telegram.org/method/account.reportProfilePhoto for reference.
type AccountReportProfilePhotoRequest struct {
	// The dialog
	Peer InputPeerClass
	// Dialog photo ID
	PhotoID InputPhotoClass
	// Report reason
	Reason ReportReasonClass
	// Comment for report moderation
	Message string
}

// AccountReportProfilePhotoRequestTypeID is TL type id of AccountReportProfilePhotoRequest.
const AccountReportProfilePhotoRequestTypeID = 0xfa8cc6f5

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

func ( *AccountReportProfilePhotoRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.PhotoID == nil) {
		return false
	}
	if !(.Reason == nil) {
		return false
	}
	if !(.Message == "") {
		return false
	}

	return true
}

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

// FillFrom fills AccountReportProfilePhotoRequest from given interface.
func ( *AccountReportProfilePhotoRequest) ( interface {
	() ( InputPeerClass)
	() ( InputPhotoClass)
	() ( ReportReasonClass)
	() ( string)
}) {
	.Peer = .()
	.PhotoID = .()
	.Reason = .()
	.Message = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountReportProfilePhotoRequest) () string {
	return "account.reportProfilePhoto"
}

// TypeInfo returns info about TL type.
func ( *AccountReportProfilePhotoRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.reportProfilePhoto",
		ID:   AccountReportProfilePhotoRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "PhotoID",
			SchemaName: "photo_id",
		},
		{
			Name:       "Reason",
			SchemaName: "reason",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountReportProfilePhotoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.reportProfilePhoto#fa8cc6f5 as nil")
	}
	.PutID(AccountReportProfilePhotoRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountReportProfilePhotoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.reportProfilePhoto#fa8cc6f5 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode account.reportProfilePhoto#fa8cc6f5: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode account.reportProfilePhoto#fa8cc6f5: field peer: %w", )
	}
	if .PhotoID == nil {
		return fmt.Errorf("unable to encode account.reportProfilePhoto#fa8cc6f5: field photo_id is nil")
	}
	if  := .PhotoID.Encode();  != nil {
		return fmt.Errorf("unable to encode account.reportProfilePhoto#fa8cc6f5: field photo_id: %w", )
	}
	if .Reason == nil {
		return fmt.Errorf("unable to encode account.reportProfilePhoto#fa8cc6f5: field reason is nil")
	}
	if  := .Reason.Encode();  != nil {
		return fmt.Errorf("unable to encode account.reportProfilePhoto#fa8cc6f5: field reason: %w", )
	}
	.PutString(.Message)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountReportProfilePhotoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.reportProfilePhoto#fa8cc6f5 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode account.reportProfilePhoto#fa8cc6f5: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeInputPhoto()
		if  != nil {
			return fmt.Errorf("unable to decode account.reportProfilePhoto#fa8cc6f5: field photo_id: %w", )
		}
		.PhotoID = 
	}
	{
		,  := DecodeReportReason()
		if  != nil {
			return fmt.Errorf("unable to decode account.reportProfilePhoto#fa8cc6f5: field reason: %w", )
		}
		.Reason = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode account.reportProfilePhoto#fa8cc6f5: field message: %w", )
		}
		.Message = 
	}
	return nil
}

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

// GetPhotoID returns value of PhotoID field.
func ( *AccountReportProfilePhotoRequest) () ( InputPhotoClass) {
	if  == nil {
		return
	}
	return .PhotoID
}

// GetReason returns value of Reason field.
func ( *AccountReportProfilePhotoRequest) () ( ReportReasonClass) {
	if  == nil {
		return
	}
	return .Reason
}

// GetMessage returns value of Message field.
func ( *AccountReportProfilePhotoRequest) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// GetPhotoIDAsNotEmpty returns mapped value of PhotoID field.
func ( *AccountReportProfilePhotoRequest) () (*InputPhoto, bool) {
	return .PhotoID.AsNotEmpty()
}

// AccountReportProfilePhoto invokes method account.reportProfilePhoto#fa8cc6f5 returning error if any.
// Report a profile photo of a dialog
//
// Possible errors:
//
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//
// See https://core.telegram.org/method/account.reportProfilePhoto for reference.
func ( *Client) ( context.Context,  *AccountReportProfilePhotoRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}