// Code generated by gotdgen, DO NOT EDIT.

package mt

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

// FutureSalt represents TL type `future_salt#949d9dc`.
type FutureSalt struct {
	// ValidSince field of FutureSalt.
	ValidSince int
	// ValidUntil field of FutureSalt.
	ValidUntil int
	// Salt field of FutureSalt.
	Salt int64
}

// FutureSaltTypeID is TL type id of FutureSalt.
const FutureSaltTypeID = 0x949d9dc

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

func ( *FutureSalt) () bool {
	if  == nil {
		return true
	}
	if !(.ValidSince == 0) {
		return false
	}
	if !(.ValidUntil == 0) {
		return false
	}
	if !(.Salt == 0) {
		return false
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *FutureSalt) () tdp.Type {
	 := tdp.Type{
		Name: "future_salt",
		ID:   FutureSaltTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ValidSince",
			SchemaName: "valid_since",
		},
		{
			Name:       "ValidUntil",
			SchemaName: "valid_until",
		},
		{
			Name:       "Salt",
			SchemaName: "salt",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *FutureSalt) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode future_salt#949d9dc as nil")
	}
	.PutID(FutureSaltTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *FutureSalt) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode future_salt#949d9dc as nil")
	}
	.PutInt(.ValidSince)
	.PutInt(.ValidUntil)
	.PutLong(.Salt)
	return nil
}

// Decode implements bin.Decoder.
func ( *FutureSalt) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode future_salt#949d9dc to nil")
	}
	if  := .ConsumeID(FutureSaltTypeID);  != nil {
		return fmt.Errorf("unable to decode future_salt#949d9dc: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *FutureSalt) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode future_salt#949d9dc to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode future_salt#949d9dc: field valid_since: %w", )
		}
		.ValidSince = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode future_salt#949d9dc: field valid_until: %w", )
		}
		.ValidUntil = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode future_salt#949d9dc: field salt: %w", )
		}
		.Salt = 
	}
	return nil
}

// GetValidSince returns value of ValidSince field.
func ( *FutureSalt) () ( int) {
	if  == nil {
		return
	}
	return .ValidSince
}

// GetValidUntil returns value of ValidUntil field.
func ( *FutureSalt) () ( int) {
	if  == nil {
		return
	}
	return .ValidUntil
}

// GetSalt returns value of Salt field.
func ( *FutureSalt) () ( int64) {
	if  == nil {
		return
	}
	return .Salt
}