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

// InvokeWithoutUpdatesRequest represents TL type `invokeWithoutUpdates#bf9459b7`.
// Invoke a request without subscribing the used connection for updates¹ (this is
// enabled by default for file queries²).
//
// Links:
//  1. https://core.telegram.org/api/updates
//  2. https://core.telegram.org/api/files
//
// See https://core.telegram.org/constructor/invokeWithoutUpdates for reference.
type InvokeWithoutUpdatesRequest struct {
	// The query
	Query bin.Object
}

// InvokeWithoutUpdatesRequestTypeID is TL type id of InvokeWithoutUpdatesRequest.
const InvokeWithoutUpdatesRequestTypeID = 0xbf9459b7

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

func ( *InvokeWithoutUpdatesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Query == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InvokeWithoutUpdatesRequest from given interface.
func ( *InvokeWithoutUpdatesRequest) ( interface {
	() ( bin.Object)
}) {
	.Query = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InvokeWithoutUpdatesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "invokeWithoutUpdates",
		ID:   InvokeWithoutUpdatesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Query",
			SchemaName: "query",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InvokeWithoutUpdatesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode invokeWithoutUpdates#bf9459b7 as nil")
	}
	.PutID(InvokeWithoutUpdatesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InvokeWithoutUpdatesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode invokeWithoutUpdates#bf9459b7 as nil")
	}
	if  := .Query.Encode();  != nil {
		return fmt.Errorf("unable to encode invokeWithoutUpdates#bf9459b7: field query: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InvokeWithoutUpdatesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode invokeWithoutUpdates#bf9459b7 to nil")
	}
	{
		if  := .Query.Decode();  != nil {
			return fmt.Errorf("unable to decode invokeWithoutUpdates#bf9459b7: field query: %w", )
		}
	}
	return nil
}

// GetQuery returns value of Query field.
func ( *InvokeWithoutUpdatesRequest) () ( bin.Object) {
	if  == nil {
		return
	}
	return .Query
}