// Sync updates media values.
Sync updates media values.
// Sync updates media values .
func (media *FeedMedia) Sync() error {
	id := media.ID()
	insta := media.inst
	data, err := insta.prepareData(
		map[string]interface{}{
			"media_id": id,
		},
	)
	if err != nil {
		return err
	}
	body, err := insta.sendRequest(
		&reqOptions{
			Endpoint: fmt.Sprintf(urlMediaInfo, id),
			Query:    generateSignature(data),
			IsPost:   true,
		},
	)
	if err != nil {
		return err
	}
	m := FeedMedia{}
	err = json.Unmarshal(body, &m)
	*media = m
	media.endpoint = urlMediaInfo
	media.inst = insta
	media.NextID = id
	media.setValues()
	return err
}
func ( media * FeedMedia ) Sync ( ) error { id := media . ID ( ) insta := media . inst data , err := insta . prepareData ( map [ string ] interface { } { " " : id , } , ) if err != nil { return err } body , err := insta . sendRequest ( & reqOptions { Endpoint : fmt . Sprintf ( urlMediaInfo , id ) , Query : generateSignature ( data ) , IsPost : true , } , ) if err != nil { return err } m := FeedMedia { } err = json . Unmarshal ( body , & m ) * media = m media . endpoint = urlMediaInfo media . inst = insta media . NextID = id media . setValues ( ) return err }
Sync updates media values.
Sync updates media values .