You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tl_video_gen.go
    path of file: ./repos/td/tdapi
    
    the code of the file until where you have to start completion: // Code generated by gotdgen, DO NOT EDIT.

package tdapi

import (
	"context"
	"errors"
	"fmt"
	"sort"
	"strings"

	"go.uber.org/multierr"

	"github.com/gotd/td/bin"
	"github.com/gotd/td/tdjson"
	"github.com/gotd/td/tdp"
	"github.com/gotd/td/tgerr"
)

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

// Video represents TL type `video#31a460cc`.
type Video struct {
	// Duration of the video, in seconds; as defined by the sender
	Duration int32
	// Video width; as defined by the sender
	Width int32
	// Video
    
func (v *Video) DecodeTDLibJSON(b tdjson.Decoder) error {
	if v == nil {
		return fmt.Errorf("can't decode video#31a460cc to nil")
	}

	return b.Obj(func(b tdjson.Decoder, key []byte) error {
		switch string(key) {
		case tdjson.TypeField:
			if err := b.ConsumeID("video"); err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: %w", err)
			}
		case "duration":
			value, err := b.Int32()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field duration: %w", err)
			}
			v.Duration = value
		case "width":
			value, err := b.Int32()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field width: %w", err)
			}
			v.Width = value
		case "height":
			value, err := b.Int32()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field height: %w", err)
			}
			v.Height = value
		case "file_name":
			value, err := b.String()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field file_name: %w", err)
			}
			v.FileName = value
		case "mime_type":
			value, err := b.String()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field mime_type: %w", err)
			}
			v.MimeType = value
		case "has_stickers":
			value, err := b.Bool()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field has_stickers: %w", err)
			}
			v.HasStickers = value
		case "supports_streaming":
			value, err := b.Bool()
			if err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field supports_streaming: %w", err)
			}
			v.SupportsStreaming = value
		case "minithumbnail":
			if err := v.Minithumbnail.DecodeTDLibJSON(b); err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field minithumbnail: %w", err)
			}
		case "thumbnail":
			if err := v.Thumbnail.DecodeTDLibJSON(b); err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field thumbnail: %w", err)
			}
		case "video":
			if err := v.Video.DecodeTDLibJSON(b); err != nil {
				return fmt.Errorf("unable to decode video#31a460cc: field video: %w", err)
			}
		default:
			return b.Skip()
		}
		return nil
	})
}