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

// StoriesToggleAllStoriesHiddenRequest represents TL type `stories.toggleAllStoriesHidden#7c2557c4`.
// Hide the active stories of a specific peer, preventing them from being displayed on
// the action bar on the homescreen.
//
// See https://core.telegram.org/method/stories.toggleAllStoriesHidden for reference.
type StoriesToggleAllStoriesHiddenRequest struct {
	// Whether to hide or unhide all active stories of the peer
	Hidden bool
}

// StoriesToggleAllStoriesHiddenRequestTypeID is TL type id of StoriesToggleAllStoriesHiddenRequest.
const StoriesToggleAllStoriesHiddenRequestTypeID = 0x7c2557c4

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

func ( *StoriesToggleAllStoriesHiddenRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hidden == false) {
		return false
	}

	return true
}

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

// FillFrom fills StoriesToggleAllStoriesHiddenRequest from given interface.
func ( *StoriesToggleAllStoriesHiddenRequest) ( interface {
	() ( bool)
}) {
	.Hidden = .()
}

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

// TypeName returns name of type in TL schema.
func (*StoriesToggleAllStoriesHiddenRequest) () string {
	return "stories.toggleAllStoriesHidden"
}

// TypeInfo returns info about TL type.
func ( *StoriesToggleAllStoriesHiddenRequest) () tdp.Type {
	 := tdp.Type{
		Name: "stories.toggleAllStoriesHidden",
		ID:   StoriesToggleAllStoriesHiddenRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hidden",
			SchemaName: "hidden",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *StoriesToggleAllStoriesHiddenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stories.toggleAllStoriesHidden#7c2557c4 as nil")
	}
	.PutID(StoriesToggleAllStoriesHiddenRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *StoriesToggleAllStoriesHiddenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stories.toggleAllStoriesHidden#7c2557c4 as nil")
	}
	.PutBool(.Hidden)
	return nil
}

// Decode implements bin.Decoder.
func ( *StoriesToggleAllStoriesHiddenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stories.toggleAllStoriesHidden#7c2557c4 to nil")
	}
	if  := .ConsumeID(StoriesToggleAllStoriesHiddenRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode stories.toggleAllStoriesHidden#7c2557c4: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *StoriesToggleAllStoriesHiddenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stories.toggleAllStoriesHidden#7c2557c4 to nil")
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode stories.toggleAllStoriesHidden#7c2557c4: field hidden: %w", )
		}
		.Hidden = 
	}
	return nil
}

// GetHidden returns value of Hidden field.
func ( *StoriesToggleAllStoriesHiddenRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Hidden
}

// StoriesToggleAllStoriesHidden invokes method stories.toggleAllStoriesHidden#7c2557c4 returning error if any.
// Hide the active stories of a specific peer, preventing them from being displayed on
// the action bar on the homescreen.
//
// See https://core.telegram.org/method/stories.toggleAllStoriesHidden for reference.
func ( *Client) ( context.Context,  bool) (bool, error) {
	var  BoolBox

	 := &StoriesToggleAllStoriesHiddenRequest{
		Hidden: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}