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

// StickersCheckShortNameRequest represents TL type `stickers.checkShortName#284b3639`.
// Check whether the given short name is available
//
// See https://core.telegram.org/method/stickers.checkShortName for reference.
type StickersCheckShortNameRequest struct {
	// Short name
	ShortName string
}

// StickersCheckShortNameRequestTypeID is TL type id of StickersCheckShortNameRequest.
const StickersCheckShortNameRequestTypeID = 0x284b3639

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

func ( *StickersCheckShortNameRequest) () bool {
	if  == nil {
		return true
	}
	if !(.ShortName == "") {
		return false
	}

	return true
}

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

// FillFrom fills StickersCheckShortNameRequest from given interface.
func ( *StickersCheckShortNameRequest) ( interface {
	() ( string)
}) {
	.ShortName = .()
}

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

// TypeName returns name of type in TL schema.
func (*StickersCheckShortNameRequest) () string {
	return "stickers.checkShortName"
}

// TypeInfo returns info about TL type.
func ( *StickersCheckShortNameRequest) () tdp.Type {
	 := tdp.Type{
		Name: "stickers.checkShortName",
		ID:   StickersCheckShortNameRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ShortName",
			SchemaName: "short_name",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *StickersCheckShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.checkShortName#284b3639 as nil")
	}
	.PutID(StickersCheckShortNameRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *StickersCheckShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.checkShortName#284b3639 as nil")
	}
	.PutString(.ShortName)
	return nil
}

// Decode implements bin.Decoder.
func ( *StickersCheckShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stickers.checkShortName#284b3639 to nil")
	}
	if  := .ConsumeID(StickersCheckShortNameRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode stickers.checkShortName#284b3639: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *StickersCheckShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stickers.checkShortName#284b3639 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode stickers.checkShortName#284b3639: field short_name: %w", )
		}
		.ShortName = 
	}
	return nil
}

// GetShortName returns value of ShortName field.
func ( *StickersCheckShortNameRequest) () ( string) {
	if  == nil {
		return
	}
	return .ShortName
}

// StickersCheckShortName invokes method stickers.checkShortName#284b3639 returning error if any.
// Check whether the given short name is available
//
// Possible errors:
//
//	400 SHORT_NAME_INVALID: The specified short name is invalid.
//	400 SHORT_NAME_OCCUPIED: The specified short name is already in use.
//
// See https://core.telegram.org/method/stickers.checkShortName for reference.
func ( *Client) ( context.Context,  string) (bool, error) {
	var  BoolBox

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