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

// InputPhoneCall represents TL type `inputPhoneCall#1e36fded`.
// Phone call
//
// See https://core.telegram.org/constructor/inputPhoneCall for reference.
type InputPhoneCall struct {
	// Call ID
	ID int64
	// Access hash
	AccessHash int64
}

// InputPhoneCallTypeID is TL type id of InputPhoneCall.
const InputPhoneCallTypeID = 0x1e36fded

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

func ( *InputPhoneCall) () bool {
	if  == nil {
		return true
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills InputPhoneCall from given interface.
func ( *InputPhoneCall) ( interface {
	() ( int64)
	() ( int64)
}) {
	.ID = .()
	.AccessHash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InputPhoneCall) () tdp.Type {
	 := tdp.Type{
		Name: "inputPhoneCall",
		ID:   InputPhoneCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPhoneCall#1e36fded as nil")
	}
	.PutID(InputPhoneCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputPhoneCall#1e36fded as nil")
	}
	.PutLong(.ID)
	.PutLong(.AccessHash)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPhoneCall#1e36fded to nil")
	}
	if  := .ConsumeID(InputPhoneCallTypeID);  != nil {
		return fmt.Errorf("unable to decode inputPhoneCall#1e36fded: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputPhoneCall#1e36fded to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhoneCall#1e36fded: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputPhoneCall#1e36fded: field access_hash: %w", )
		}
		.AccessHash = 
	}
	return nil
}

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

// GetAccessHash returns value of AccessHash field.
func ( *InputPhoneCall) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}