// Sync function is used when Highlight must be sync.
// Highlight must be sync when User.Highlights does not return any object inside StoryMedia slice.
//
// This function does NOT update Stories items.
//
// This function updates StoryMedia.Items
Sync function is used when Highlight must be sync.
Highlight must be sync when User.Highlights does not return any object inside StoryMedia slice.

This function does NOT update Stories items.

This function updates StoryMedia.Items
// Sync function is used when Highlight must be sync . // Highlight must be sync when User . Highlights does not return any object inside StoryMedia slice . // // This function does NOT update Stories items . // // This function updates StoryMedia . Items
func (media *StoryMedia) Sync() error {
	insta := media.inst
	query := []trayRequest{
		{"SUPPORTED_SDK_VERSIONS", "9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0"},
		{"FACE_TRACKER_VERSION", "10"},
		{"segmentation", "segmentation_enabled"},
		{"COMPRESSION", "ETC2_COMPRESSION"},
	}
	qjson, err := json.Marshal(query)
	if err != nil {
		return err
	}
	id := media.Pk.(string)
	data, err := insta.prepareData(
		map[string]interface{}{
			"user_ids":                   []string{id},
			"supported_capabilities_new": b2s(qjson),
		},
	)
	if err != nil {
		return err
	}
	body, err := insta.sendRequest(
		&reqOptions{
			Endpoint: urlReelMedia,
			Query:    generateSignature(data),
			IsPost:   true,
		},
	)
	if err == nil {
		resp := trayResp{}
		err = json.Unmarshal(body, &resp)
		if err == nil {
			m, ok := resp.Reels[id]
			if ok {
				media.Items = m.Items
				media.setValues()
				return nil
			}
			err = fmt.Errorf("cannot find %s structure in response", id)
		}
	}
	return err
}
func ( media * StoryMedia ) Sync ( ) error { insta := media . inst query := [ ] trayRequest { { " " , " " } , { " " , " " } , { " " , " " } , { " " , " " } , } qjson , err := json . Marshal ( query ) if err != nil { return err } id := media . Pk . ( string ) data , err := insta . prepareData ( map [ string ] interface { } { " " : [ ] string { id } , " " : b2s ( qjson ) , } , ) if err != nil { return err } body , err := insta . sendRequest ( & reqOptions { Endpoint : urlReelMedia , Query : generateSignature ( data ) , IsPost : true , } , ) if err == nil { resp := trayResp { } err = json . Unmarshal ( body , & resp ) if err == nil { m , ok := resp . Reels [ id ] if ok { media . Items = m . Items media . setValues ( ) return nil } err = fmt . Errorf ( " " , id ) } } return err }
Sync function is used when Highlight must be sync.
Sync function is used when Highlight must be sync .