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

// UsersSuggestBirthdayRequest represents TL type `users.suggestBirthday#fc533372`.
// Suggest a birthday to another user, see here »¹ for more info on birthdays in the
// API.
//
// Links:
//  1. https://core.telegram.org/api/profile#birthday
//
// See https://core.telegram.org/method/users.suggestBirthday for reference.
type UsersSuggestBirthdayRequest struct {
	// The user that will receive the suggested birthday date.
	ID InputUserClass
	// The birthday to suggest.
	Birthday Birthday
}

// UsersSuggestBirthdayRequestTypeID is TL type id of UsersSuggestBirthdayRequest.
const UsersSuggestBirthdayRequestTypeID = 0xfc533372

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

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

	return true
}

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

// FillFrom fills UsersSuggestBirthdayRequest from given interface.
func ( *UsersSuggestBirthdayRequest) ( interface {
	() ( InputUserClass)
	() ( Birthday)
}) {
	.ID = .()
	.Birthday = .()
}

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

// TypeName returns name of type in TL schema.
func (*UsersSuggestBirthdayRequest) () string {
	return "users.suggestBirthday"
}

// TypeInfo returns info about TL type.
func ( *UsersSuggestBirthdayRequest) () tdp.Type {
	 := tdp.Type{
		Name: "users.suggestBirthday",
		ID:   UsersSuggestBirthdayRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Birthday",
			SchemaName: "birthday",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *UsersSuggestBirthdayRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode users.suggestBirthday#fc533372 as nil")
	}
	.PutID(UsersSuggestBirthdayRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UsersSuggestBirthdayRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode users.suggestBirthday#fc533372 as nil")
	}
	if .ID == nil {
		return fmt.Errorf("unable to encode users.suggestBirthday#fc533372: field id is nil")
	}
	if  := .ID.Encode();  != nil {
		return fmt.Errorf("unable to encode users.suggestBirthday#fc533372: field id: %w", )
	}
	if  := .Birthday.Encode();  != nil {
		return fmt.Errorf("unable to encode users.suggestBirthday#fc533372: field birthday: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *UsersSuggestBirthdayRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode users.suggestBirthday#fc533372 to nil")
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode users.suggestBirthday#fc533372: field id: %w", )
		}
		.ID = 
	}
	{
		if  := .Birthday.Decode();  != nil {
			return fmt.Errorf("unable to decode users.suggestBirthday#fc533372: field birthday: %w", )
		}
	}
	return nil
}

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

// GetBirthday returns value of Birthday field.
func ( *UsersSuggestBirthdayRequest) () ( Birthday) {
	if  == nil {
		return
	}
	return .Birthday
}

// UsersSuggestBirthday invokes method users.suggestBirthday#fc533372 returning error if any.
// Suggest a birthday to another user, see here »¹ for more info on birthdays in the
// API.
//
// Links:
//  1. https://core.telegram.org/api/profile#birthday
//
// Possible errors:
//
//	400 USER_ID_INVALID: The provided user ID is invalid.
//
// See https://core.telegram.org/method/users.suggestBirthday for reference.
func ( *Client) ( context.Context,  *UsersSuggestBirthdayRequest) (UpdatesClass, error) {
	var  UpdatesBox

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