// GetDownloadURL returns the DownloadURL field if it's non-nil, zero value otherwise.
761358
func (r *RepositoryContent) GetDownloadURL() string {
	if r == nil || r.DownloadURL == nil {
		return ""
	}
	return *r.DownloadURL
}
716509
func (c *Commit) GetHTMLURL() string {
	if c == nil || c.HTMLURL == nil {
		return ""
	}
	return *c.HTMLURL
}
1019780
func (c *Context) DownloadURL(url string) (filePath string, err error) {

	ext := filepath.Ext(url)
	out, err := ioutil.TempFile("", fmt.Sprintf("%d_%d", c.Bot().ID, c.Chat.ID))

	if err != nil {
		return "", err
	}

	out.Close()
	os.Rename(out.Name(), out.Name()+ext)

	out, err = os.OpenFile(out.Name()+ext, os.O_RDWR, 0666)
	if err != nil {
		return "", err
	}
	defer out.Close()

	resp, err := http.Get(url)
	if err != nil {
		return "", err
	}
	if resp.StatusCode < 200 || resp.StatusCode > 299 {
		return "", errors.New("non 2xx resp status")
	}
	defer resp.Body.Close()

	_, err = io.Copy(out, resp.Body)
	if err != nil {
		return "", err
	}

	return out.Name(), nil
}
763744
func (p *PullRequestComment) GetURL() string {
	if p == nil || p.URL == nil {
		return ""
	}
	return *p.URL
}
788033
func (h *Hook) GetURL() string {
	if h == nil || h.URL == nil {
		return ""
	}
	return *h.URL
}
166200
func (p *PullRequestReview) GetHTMLURL() string {
	if p == nil || p.HTMLURL == nil {
		return ""
	}
	return *p.HTMLURL
}
621620
func (r *RepositoryLicense) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}
1332422
func (i *Issue) GetURL() string {
	if i == nil || i.URL == nil {
		return ""
	}
	return *i.URL
}
16051
func (p *PullRequest) GetHTMLURL() string {
	if p == nil || p.HTMLURL == nil {
		return ""
	}
	return *p.HTMLURL
}
802962
func (r *Repository) GetPullsURL() string {
	if r == nil || r.PullsURL == nil {
		return ""
	}
	return *r.PullsURL
}
734259
func (c *CommitFile) GetBlobURL() string {
	if c == nil || c.BlobURL == nil {
		return ""
	}
	return *c.BlobURL
}
680401
func (r *RepositoryRelease) GetUploadURL() string {
	if r == nil || r.UploadURL == nil {
		return ""
	}
	return *r.UploadURL
}
842001
func Download(method, endpoint string, destination interface{}) (r *Requester, err error) {
	r, err = Request(method, endpoint)
	if err != nil {
		return
	}
	r.IsDownload = true
	r.Destination(destination)
	return
}
1062360
func (r *Repository) GetDownloadsURL() string {
	if r == nil || r.DownloadsURL == nil {
		return ""
	}
	return *r.DownloadsURL
}
803319
func (r *RepoStatus) GetTargetURL() string {
	if r == nil || r.TargetURL == nil {
		return ""
	}
	return *r.TargetURL
}
517140
func (p *PullRequest) GetDiffURL() string {
	if p == nil || p.DiffURL == nil {
		return ""
	}
	return *p.DiffURL
}
380220
func (a *Authorization) GetURL() string {
	if a == nil || a.URL == nil {
		return ""
	}
	return *a.URL
}