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

// StoriesActivateStealthModeRequest represents TL type `stories.activateStealthMode#57bbd166`.
// Activates stories stealth mode¹, see here »² for more info.
// Will return an updateStoriesStealthMode¹.
//
// Links:
//  1. https://core.telegram.org/api/stories#stealth-mode
//  2. https://core.telegram.org/api/stories#stealth-mode
//  3. https://core.telegram.org/constructor/updateStoriesStealthMode
//
// See https://core.telegram.org/method/stories.activateStealthMode for reference.
type StoriesActivateStealthModeRequest struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether to erase views from any stories opened in the past stories_stealth_past_period
	// seconds »¹, as specified by the client configuration².
	//
	// Links:
	//  1) https://core.telegram.org/api/config#stories-stealth-past-period
	//  2) https://core.telegram.org/api/config#client-configuration
	Past bool
	// Whether to hide future story views for the next stories_stealth_future_period seconds
	// »¹, as specified by the client configuration².
	//
	// Links:
	//  1) https://core.telegram.org/api/config#stories-stealth-future-period
	//  2) https://core.telegram.org/api/config#client-configuration
	Future bool
}

// StoriesActivateStealthModeRequestTypeID is TL type id of StoriesActivateStealthModeRequest.
const StoriesActivateStealthModeRequestTypeID = 0x57bbd166

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

func ( *StoriesActivateStealthModeRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Past == false) {
		return false
	}
	if !(.Future == false) {
		return false
	}

	return true
}

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

// FillFrom fills StoriesActivateStealthModeRequest from given interface.
func ( *StoriesActivateStealthModeRequest) ( interface {
	() ( bool)
	() ( bool)
}) {
	.Past = .()
	.Future = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *StoriesActivateStealthModeRequest) () tdp.Type {
	 := tdp.Type{
		Name: "stories.activateStealthMode",
		ID:   StoriesActivateStealthModeRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Past",
			SchemaName: "past",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Future",
			SchemaName: "future",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *StoriesActivateStealthModeRequest) () {
	if !(.Past == false) {
		.Flags.Set(0)
	}
	if !(.Future == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *StoriesActivateStealthModeRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stories.activateStealthMode#57bbd166 as nil")
	}
	.PutID(StoriesActivateStealthModeRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *StoriesActivateStealthModeRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stories.activateStealthMode#57bbd166 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode stories.activateStealthMode#57bbd166: field flags: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *StoriesActivateStealthModeRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stories.activateStealthMode#57bbd166 to nil")
	}
	if  := .ConsumeID(StoriesActivateStealthModeRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode stories.activateStealthMode#57bbd166: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *StoriesActivateStealthModeRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stories.activateStealthMode#57bbd166 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode stories.activateStealthMode#57bbd166: field flags: %w", )
		}
	}
	.Past = .Flags.Has(0)
	.Future = .Flags.Has(1)
	return nil
}

// SetPast sets value of Past conditional field.
func ( *StoriesActivateStealthModeRequest) ( bool) {
	if  {
		.Flags.Set(0)
		.Past = true
	} else {
		.Flags.Unset(0)
		.Past = false
	}
}

// GetPast returns value of Past conditional field.
func ( *StoriesActivateStealthModeRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetFuture sets value of Future conditional field.
func ( *StoriesActivateStealthModeRequest) ( bool) {
	if  {
		.Flags.Set(1)
		.Future = true
	} else {
		.Flags.Unset(1)
		.Future = false
	}
}

// GetFuture returns value of Future conditional field.
func ( *StoriesActivateStealthModeRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// StoriesActivateStealthMode invokes method stories.activateStealthMode#57bbd166 returning error if any.
// Activates stories stealth mode¹, see here »² for more info.
// Will return an updateStoriesStealthMode¹.
//
// Links:
//  1. https://core.telegram.org/api/stories#stealth-mode
//  2. https://core.telegram.org/api/stories#stealth-mode
//  3. https://core.telegram.org/constructor/updateStoriesStealthMode
//
// See https://core.telegram.org/method/stories.activateStealthMode for reference.
func ( *Client) ( context.Context,  *StoriesActivateStealthModeRequest) (UpdatesClass, error) {
	var  UpdatesBox

	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .Updates, nil
}