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

// InputBusinessGreetingMessage represents TL type `inputBusinessGreetingMessage#194cb3b`.
// Describes a Telegram Business greeting¹, automatically sent to new users writing to
// us in private for the first time, or after a certain inactivity period.
//
// Links:
//  1. https://core.telegram.org/api/business#greeting-messages
//
// See https://core.telegram.org/constructor/inputBusinessGreetingMessage for reference.
type InputBusinessGreetingMessage struct {
	// ID of a quick reply shorcut, containing the greeting messages to send, see here » for
	// more info¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/business#quick-reply-shortcuts
	ShortcutID int
	// Allowed recipients for the greeting messages.
	Recipients InputBusinessRecipients
	// The number of days after which a private chat will be considered as inactive;
	// currently, must be one of 7, 14, 21, or 28.
	NoActivityDays int
}

// InputBusinessGreetingMessageTypeID is TL type id of InputBusinessGreetingMessage.
const InputBusinessGreetingMessageTypeID = 0x194cb3b

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

func ( *InputBusinessGreetingMessage) () bool {
	if  == nil {
		return true
	}
	if !(.ShortcutID == 0) {
		return false
	}
	if !(.Recipients.Zero()) {
		return false
	}
	if !(.NoActivityDays == 0) {
		return false
	}

	return true
}

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

// FillFrom fills InputBusinessGreetingMessage from given interface.
func ( *InputBusinessGreetingMessage) ( interface {
	() ( int)
	() ( InputBusinessRecipients)
	() ( int)
}) {
	.ShortcutID = .()
	.Recipients = .()
	.NoActivityDays = .()
}

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

// TypeName returns name of type in TL schema.
func (*InputBusinessGreetingMessage) () string {
	return "inputBusinessGreetingMessage"
}

// TypeInfo returns info about TL type.
func ( *InputBusinessGreetingMessage) () tdp.Type {
	 := tdp.Type{
		Name: "inputBusinessGreetingMessage",
		ID:   InputBusinessGreetingMessageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ShortcutID",
			SchemaName: "shortcut_id",
		},
		{
			Name:       "Recipients",
			SchemaName: "recipients",
		},
		{
			Name:       "NoActivityDays",
			SchemaName: "no_activity_days",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputBusinessGreetingMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBusinessGreetingMessage#194cb3b as nil")
	}
	.PutID(InputBusinessGreetingMessageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBusinessGreetingMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBusinessGreetingMessage#194cb3b as nil")
	}
	.PutInt(.ShortcutID)
	if  := .Recipients.Encode();  != nil {
		return fmt.Errorf("unable to encode inputBusinessGreetingMessage#194cb3b: field recipients: %w", )
	}
	.PutInt(.NoActivityDays)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputBusinessGreetingMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBusinessGreetingMessage#194cb3b to nil")
	}
	if  := .ConsumeID(InputBusinessGreetingMessageTypeID);  != nil {
		return fmt.Errorf("unable to decode inputBusinessGreetingMessage#194cb3b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputBusinessGreetingMessage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBusinessGreetingMessage#194cb3b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBusinessGreetingMessage#194cb3b: field shortcut_id: %w", )
		}
		.ShortcutID = 
	}
	{
		if  := .Recipients.Decode();  != nil {
			return fmt.Errorf("unable to decode inputBusinessGreetingMessage#194cb3b: field recipients: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBusinessGreetingMessage#194cb3b: field no_activity_days: %w", )
		}
		.NoActivityDays = 
	}
	return nil
}

// GetShortcutID returns value of ShortcutID field.
func ( *InputBusinessGreetingMessage) () ( int) {
	if  == nil {
		return
	}
	return .ShortcutID
}

// GetRecipients returns value of Recipients field.
func ( *InputBusinessGreetingMessage) () ( InputBusinessRecipients) {
	if  == nil {
		return
	}
	return .Recipients
}

// GetNoActivityDays returns value of NoActivityDays field.
func ( *InputBusinessGreetingMessage) () ( int) {
	if  == nil {
		return
	}
	return .NoActivityDays
}