func (r *GetLargeFilesReq) Rel(link string, resp *GetLargeFilesResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
/*
Rel updates this request to point to a relative link from resp. Returns false if
the link does not exist. Handy for paging.
package migrations
import (
	"context"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func CancelImport(ctx context.Context, req *CancelImportReq, opt ...requests.Option) (*CancelImportResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CancelImportReq)
	}
	resp := &CancelImportResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) CancelImport(ctx context.Context, req *CancelImportReq, opt ...requests.Option) (*CancelImportResponse, error) {
	return CancelImport(ctx, req, append(c, opt...)...)
}
type CancelImportReq struct {
	_url  string
	Owner string
	Repo  string
}
func (r *CancelImportReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "DELETE",
		Options:     opt,
		URLPath:     fmt.Sprintf("/repos/%v/%v/import", r.Owner, r.Repo),
	})
}
func (r *CancelImportReq) Rel(link string, resp *CancelImportResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CancelImportResponse struct {
	httpResponse *http.Response
}
func (r *CancelImportResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CancelImportResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204})
	if err != nil {
		return err
	}
	return nil
}
func DeleteArchiveForAuthenticatedUser(ctx context.Context, req *DeleteArchiveForAuthenticatedUserReq, opt ...requests.Option) (*DeleteArchiveForAuthenticatedUserResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(DeleteArchiveForAuthenticatedUserReq)
	}
	resp := &DeleteArchiveForAuthenticatedUserResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) DeleteArchiveForAuthenticatedUser(ctx context.Context, req *DeleteArchiveForAuthenticatedUserReq, opt ...requests.Option) (*DeleteArchiveForAuthenticatedUserResponse, error) {
	return DeleteArchiveForAuthenticatedUser(ctx, req, append(c, opt...)...)
}
type DeleteArchiveForAuthenticatedUserReq struct {
	_url string
	MigrationId int64
	WyandottePreview bool
}
func (r *DeleteArchiveForAuthenticatedUserReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews:      []string{"wyandotte"},
		ExplicitURL:      r._url,
		Method:           "DELETE",
		Options:          opt,
		Previews:         map[string]bool{"wyandotte": r.WyandottePreview},
		RequiredPreviews: []string{"wyandotte"},
		URLPath:          fmt.Sprintf("/user/migrations/%v/archive", r.MigrationId),
	})
}
func (r *DeleteArchiveForAuthenticatedUserReq) Rel(link string, resp *DeleteArchiveForAuthenticatedUserResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type DeleteArchiveForAuthenticatedUserResponse struct {
	httpResponse *http.Response
}
func (r *DeleteArchiveForAuthenticatedUserResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *DeleteArchiveForAuthenticatedUserResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 304})
	if err != nil {
		return err
	}
	return nil
}
func DeleteArchiveForOrg(ctx context.Context, req *DeleteArchiveForOrgReq, opt ...requests.Option) (*DeleteArchiveForOrgResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(DeleteArchiveForOrgReq)
	}
	resp := &DeleteArchiveForOrgResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) DeleteArchiveForOrg(ctx context.Context, req *DeleteArchiveForOrgReq, opt ...requests.Option) (*DeleteArchiveForOrgResponse, error) {
	return DeleteArchiveForOrg(ctx, req, append(c, opt...)...)
}
type DeleteArchiveForOrgReq struct {
	_url string
	Org  string
	MigrationId int64
	WyandottePreview bool
}
func (r *DeleteArchiveForOrgReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews:      []string{"wyandotte"},
		ExplicitURL:      r._url,
		Method:           "DELETE",
		Options:          opt,
		Previews:         map[string]bool{"wyandotte": r.WyandottePreview},
		RequiredPreviews: []string{"wyandotte"},
		URLPath:          fmt.Sprintf("/orgs/%v/migrations/%v/archive", r.Org, r.MigrationId),
	})
}
func (r *DeleteArchiveForOrgReq) Rel(link string, resp *DeleteArchiveForOrgResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type DeleteArchiveForOrgResponse struct {
	httpResponse *http.Response
	Data         bool
}
func (r *DeleteArchiveForOrgResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *DeleteArchiveForOrgResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 404})
	if err != nil {
		return err
	}
	err = setBoolResult(resp, &r.Data)
	if err != nil {
		return err
	}
	return nil
}
func DownloadArchiveForOrg(ctx context.Context, req *DownloadArchiveForOrgReq, opt ...requests.Option) (*DownloadArchiveForOrgResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(DownloadArchiveForOrgReq)
	}
	resp := &DownloadArchiveForOrgResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) DownloadArchiveForOrg(ctx context.Context, req *DownloadArchiveForOrgReq, opt ...requests.Option) (*DownloadArchiveForOrgResponse, error) {
	return DownloadArchiveForOrg(ctx, req, append(c, opt...)...)
}
type DownloadArchiveForOrgReq struct {
	_url string
	Org  string
	MigrationId int64
	WyandottePreview bool
}
func (r *DownloadArchiveForOrgReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews:      []string{"wyandotte"},
		ExplicitURL:      r._url,
		Method:           "GET",
		Options:          opt,
		Previews:         map[string]bool{"wyandotte": r.WyandottePreview},
		RequiredPreviews: []string{"wyandotte"},
		URLPath:          fmt.Sprintf("/orgs/%v/migrations/%v/archive", r.Org, r.MigrationId),
	})
}
func (r *DownloadArchiveForOrgReq) Rel(link string, resp *DownloadArchiveForOrgResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type DownloadArchiveForOrgResponse struct {
	httpResponse *http.Response
}
func (r *DownloadArchiveForOrgResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *DownloadArchiveForOrgResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{302})
	if err != nil {
		return err
	}
	return nil
}
func GetArchiveForAuthenticatedUser(ctx context.Context, req *GetArchiveForAuthenticatedUserReq, opt ...requests.Option) (*GetArchiveForAuthenticatedUserResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(GetArchiveForAuthenticatedUserReq)
	}
	resp := &GetArchiveForAuthenticatedUserResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) GetArchiveForAuthenticatedUser(ctx context.Context, req *GetArchiveForAuthenticatedUserReq, opt ...requests.Option) (*GetArchiveForAuthenticatedUserResponse, error) {
	return GetArchiveForAuthenticatedUser(ctx, req, append(c, opt...)...)
}
type GetArchiveForAuthenticatedUserReq struct {
	_url string
	MigrationId int64
	WyandottePreview bool
}
func (r *GetArchiveForAuthenticatedUserReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews:      []string{"wyandotte"},
		ExplicitURL:      r._url,
		Method:           "GET",
		Options:          opt,
		Previews:         map[string]bool{"wyandotte": r.WyandottePreview},
		RequiredPreviews: []string{"wyandotte"},
		URLPath:          fmt.Sprintf("/user/migrations/%v/archive", r.MigrationId),
	})
}
func (r *GetArchiveForAuthenticatedUserReq) Rel(link string, resp *GetArchiveForAuthenticatedUserResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type GetArchiveForAuthenticatedUserResponse struct {
	httpResponse *http.Response
}
func (r *GetArchiveForAuthenticatedUserResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *GetArchiveForAuthenticatedUserResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{302, 304})
	if err != nil {
		return err
	}
	return nil
}
func GetCommitAuthors(ctx context.Context, req *GetCommitAuthorsReq, opt ...requests.Option) (*GetCommitAuthorsResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(GetCommitAuthorsReq)
	}
	resp := &GetCommitAuthorsResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) GetCommitAuthors(ctx context.Context, req *GetCommitAuthorsReq, opt ...requests.Option) (*GetCommitAuthorsResponse, error) {
	return GetCommitAuthors(ctx, req, append(c, opt...)...)
}
type GetCommitAuthorsReq struct {
	_url  string
	Owner string
	Repo  string
	Since *string
}
func (r *GetCommitAuthorsReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	query := url.Values{}
	if r.Since != nil {
		query.Set("since", *r.Since)
	}
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		HeaderVals:  map[string]*string{"accept": strPtr("application/json")},
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/repos/%v/%v/import/authors", r.Owner, r.Repo),
		URLQuery:    query,
	})
}
func (r *GetCommitAuthorsReq) Rel(link string, resp *GetCommitAuthorsResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type GetCommitAuthorsResponse struct {
	httpResponse *http.Response
	Data         []components.PorterAuthor
}
func (r *GetCommitAuthorsResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *GetCommitAuthorsResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{200})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{200}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func GetImportStatus(ctx context.Context, req *GetImportStatusReq, opt ...requests.Option) (*GetImportStatusResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(GetImportStatusReq)
	}
	resp := &GetImportStatusResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) GetImportStatus(ctx context.Context, req *GetImportStatusReq, opt ...requests.Option) (*GetImportStatusResponse, error) {
	return GetImportStatus(ctx, req, append(c, opt...)...)
}
type GetImportStatusReq struct {
	_url  string
	Owner string
	Repo  string
}
func (r *GetImportStatusReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		HeaderVals:  map[string]*string{"accept": strPtr("application/json")},
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/repos/%v/%v/import", r.Owner, r.Repo),
	})
}
func (r *GetImportStatusReq) Rel(link string, resp *GetImportStatusResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type GetImportStatusResponse struct {
	httpResponse *http.Response
	Data         components.Import
}
func (r *GetImportStatusResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *GetImportStatusResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{200})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{200}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func GetLargeFiles(ctx context.Context, req *GetLargeFilesReq, opt ...requests.Option) (*GetLargeFilesResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(GetLargeFilesReq)
	}
	resp := &GetLargeFilesResponse{}
	httpReq, err := req.HTTPRequest(ctx, opt...)
	if err != nil {
		return nil, err
	}
	r, err := opts.HttpClient().Do(httpReq)
	if err != nil {
		return nil, err
	}
	err = resp.ReadResponse(r)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func (c Client) GetLargeFiles(ctx context.Context, req *GetLargeFilesReq, opt ...requests.Option) (*GetLargeFilesResponse, error) {
	return GetLargeFiles(ctx, req, append(c, opt...)...)
}
type GetLargeFilesReq struct {
	_url  string
	Owner string
	Repo  string
}
func (r *GetLargeFilesReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		HeaderVals:  map[string]*string{"accept": strPtr("application/json")},
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/repos/%v/%v/import/large_files", r.Owner, r.Repo),
	})
}