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

// PhoneGroupCallStreamRtmpURL represents TL type `phone.groupCallStreamRtmpUrl#2dbf3432`.
// RTMP URL and stream key to be used in streaming software
//
// See https://core.telegram.org/constructor/phone.groupCallStreamRtmpUrl for reference.
type PhoneGroupCallStreamRtmpURL struct {
	// RTMP URL
	URL string
	// Stream key
	Key string
}

// PhoneGroupCallStreamRtmpURLTypeID is TL type id of PhoneGroupCallStreamRtmpURL.
const PhoneGroupCallStreamRtmpURLTypeID = 0x2dbf3432

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

func ( *PhoneGroupCallStreamRtmpURL) () bool {
	if  == nil {
		return true
	}
	if !(.URL == "") {
		return false
	}
	if !(.Key == "") {
		return false
	}

	return true
}

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

// FillFrom fills PhoneGroupCallStreamRtmpURL from given interface.
func ( *PhoneGroupCallStreamRtmpURL) ( interface {
	() ( string)
	() ( string)
}) {
	.URL = .()
	.Key = .()
}

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

// TypeName returns name of type in TL schema.
func (*PhoneGroupCallStreamRtmpURL) () string {
	return "phone.groupCallStreamRtmpUrl"
}

// TypeInfo returns info about TL type.
func ( *PhoneGroupCallStreamRtmpURL) () tdp.Type {
	 := tdp.Type{
		Name: "phone.groupCallStreamRtmpUrl",
		ID:   PhoneGroupCallStreamRtmpURLTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "URL",
			SchemaName: "url",
		},
		{
			Name:       "Key",
			SchemaName: "key",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PhoneGroupCallStreamRtmpURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.groupCallStreamRtmpUrl#2dbf3432 as nil")
	}
	.PutID(PhoneGroupCallStreamRtmpURLTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PhoneGroupCallStreamRtmpURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.groupCallStreamRtmpUrl#2dbf3432 as nil")
	}
	.PutString(.URL)
	.PutString(.Key)
	return nil
}

// Decode implements bin.Decoder.
func ( *PhoneGroupCallStreamRtmpURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.groupCallStreamRtmpUrl#2dbf3432 to nil")
	}
	if  := .ConsumeID(PhoneGroupCallStreamRtmpURLTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.groupCallStreamRtmpUrl#2dbf3432: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneGroupCallStreamRtmpURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.groupCallStreamRtmpUrl#2dbf3432 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode phone.groupCallStreamRtmpUrl#2dbf3432: field url: %w", )
		}
		.URL = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode phone.groupCallStreamRtmpUrl#2dbf3432: field key: %w", )
		}
		.Key = 
	}
	return nil
}

// GetURL returns value of URL field.
func ( *PhoneGroupCallStreamRtmpURL) () ( string) {
	if  == nil {
		return
	}
	return .URL
}

// GetKey returns value of Key field.
func ( *PhoneGroupCallStreamRtmpURL) () ( string) {
	if  == nil {
		return
	}
	return .Key
}