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

// InvokeWithGooglePlayIntegrityRequest represents TL type `invokeWithGooglePlayIntegrity#1df92984`.
// Official clients only, invoke with Google Play Integrity token.
//
// See https://core.telegram.org/constructor/invokeWithGooglePlayIntegrity for reference.
type InvokeWithGooglePlayIntegrityRequest struct {
	// Nonce.
	Nonce string
	// Token.
	Token string
	// Query.
	Query bin.Object
}

// InvokeWithGooglePlayIntegrityRequestTypeID is TL type id of InvokeWithGooglePlayIntegrityRequest.
const InvokeWithGooglePlayIntegrityRequestTypeID = 0x1df92984

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

func ( *InvokeWithGooglePlayIntegrityRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Nonce == "") {
		return false
	}
	if !(.Token == "") {
		return false
	}
	if !(.Query == nil) {
		return false
	}

	return true
}

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

// FillFrom fills InvokeWithGooglePlayIntegrityRequest from given interface.
func ( *InvokeWithGooglePlayIntegrityRequest) ( interface {
	() ( string)
	() ( string)
	() ( bin.Object)
}) {
	.Nonce = .()
	.Token = .()
	.Query = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InvokeWithGooglePlayIntegrityRequest) () tdp.Type {
	 := tdp.Type{
		Name: "invokeWithGooglePlayIntegrity",
		ID:   InvokeWithGooglePlayIntegrityRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Nonce",
			SchemaName: "nonce",
		},
		{
			Name:       "Token",
			SchemaName: "token",
		},
		{
			Name:       "Query",
			SchemaName: "query",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InvokeWithGooglePlayIntegrityRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode invokeWithGooglePlayIntegrity#1df92984 as nil")
	}
	.PutID(InvokeWithGooglePlayIntegrityRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InvokeWithGooglePlayIntegrityRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode invokeWithGooglePlayIntegrity#1df92984 as nil")
	}
	.PutString(.Nonce)
	.PutString(.Token)
	if  := .Query.Encode();  != nil {
		return fmt.Errorf("unable to encode invokeWithGooglePlayIntegrity#1df92984: field query: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InvokeWithGooglePlayIntegrityRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode invokeWithGooglePlayIntegrity#1df92984 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode invokeWithGooglePlayIntegrity#1df92984: field nonce: %w", )
		}
		.Nonce = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode invokeWithGooglePlayIntegrity#1df92984: field token: %w", )
		}
		.Token = 
	}
	{
		if  := .Query.Decode();  != nil {
			return fmt.Errorf("unable to decode invokeWithGooglePlayIntegrity#1df92984: field query: %w", )
		}
	}
	return nil
}

// GetNonce returns value of Nonce field.
func ( *InvokeWithGooglePlayIntegrityRequest) () ( string) {
	if  == nil {
		return
	}
	return .Nonce
}

// GetToken returns value of Token field.
func ( *InvokeWithGooglePlayIntegrityRequest) () ( string) {
	if  == nil {
		return
	}
	return .Token
}

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