func (c Client) DeleteRef(ctx context.Context, req *DeleteRefReq, opt ...requests.Option) (*DeleteRefResponse, error) {
	return DeleteRef(ctx, req, append(c, opt...)...)
}
/*
DeleteRef performs requests for "git/delete-ref"

Delete a reference.

DELETE /repos/{owner}/{repo}/git/refs/{ref}

https://developer.github.com/v3/git/refs/#delete-a-reference

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
package git
import (
	"context"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func CreateBlob(ctx context.Context, req *CreateBlobReq, opt ...requests.Option) (*CreateBlobResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateBlobReq)
	}
	resp := &CreateBlobResponse{}
	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) CreateBlob(ctx context.Context, req *CreateBlobReq, opt ...requests.Option) (*CreateBlobResponse, error) {
	return CreateBlob(ctx, req, append(c, opt...)...)
}
type CreateBlobReq struct {
	_url        string
	Owner       string
	Repo        string
	RequestBody CreateBlobReqBody
}
func (r *CreateBlobReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/repos/%v/%v/git/blobs", r.Owner, r.Repo),
	})
}
func (r *CreateBlobReq) Rel(link string, resp *CreateBlobResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateBlobReqBody struct {
	Content *string `json:"content"`
	Encoding *string `json:"encoding,omitempty"`
}
type CreateBlobResponse struct {
	httpResponse *http.Response
	Data         components.ShortBlob
}
func (r *CreateBlobResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateBlobResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateCommit(ctx context.Context, req *CreateCommitReq, opt ...requests.Option) (*CreateCommitResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateCommitReq)
	}
	resp := &CreateCommitResponse{}
	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) CreateCommit(ctx context.Context, req *CreateCommitReq, opt ...requests.Option) (*CreateCommitResponse, error) {
	return CreateCommit(ctx, req, append(c, opt...)...)
}
type CreateCommitReq struct {
	_url        string
	Owner       string
	Repo        string
	RequestBody CreateCommitReqBody
}
func (r *CreateCommitReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/repos/%v/%v/git/commits", r.Owner, r.Repo),
	})
}
func (r *CreateCommitReq) Rel(link string, resp *CreateCommitResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateCommitReqBodyAuthor struct {
	Date *string `json:"date,omitempty"`
	Email *string `json:"email,omitempty"`
	Name *string `json:"name,omitempty"`
}
type CreateCommitReqBodyCommitter struct {
	Date *string `json:"date,omitempty"`
	Email *string `json:"email,omitempty"`
	Name *string `json:"name,omitempty"`
}
type CreateCommitReqBody struct {
	Author *CreateCommitReqBodyAuthor `json:"author,omitempty"`
	Committer *CreateCommitReqBodyCommitter `json:"committer,omitempty"`
	Message *string `json:"message"`
	Parents []string `json:"parents,omitempty"`
	Signature *string `json:"signature,omitempty"`
	Tree *string `json:"tree"`
}
type CreateCommitResponse struct {
	httpResponse *http.Response
	Data         components.GitCommit
}
func (r *CreateCommitResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateCommitResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateRef(ctx context.Context, req *CreateRefReq, opt ...requests.Option) (*CreateRefResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateRefReq)
	}
	resp := &CreateRefResponse{}
	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) CreateRef(ctx context.Context, req *CreateRefReq, opt ...requests.Option) (*CreateRefResponse, error) {
	return CreateRef(ctx, req, append(c, opt...)...)
}
type CreateRefReq struct {
	_url        string
	Owner       string
	Repo        string
	RequestBody CreateRefReqBody
}
func (r *CreateRefReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/repos/%v/%v/git/refs", r.Owner, r.Repo),
	})
}
func (r *CreateRefReq) Rel(link string, resp *CreateRefResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateRefReqBody struct {
	Key *string `json:"key,omitempty"`
	Ref *string `json:"ref"`
	Sha *string `json:"sha"`
}
type CreateRefResponse struct {
	httpResponse *http.Response
	Data         components.GitRef
}
func (r *CreateRefResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateRefResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateTag(ctx context.Context, req *CreateTagReq, opt ...requests.Option) (*CreateTagResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateTagReq)
	}
	resp := &CreateTagResponse{}
	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) CreateTag(ctx context.Context, req *CreateTagReq, opt ...requests.Option) (*CreateTagResponse, error) {
	return CreateTag(ctx, req, append(c, opt...)...)
}
type CreateTagReq struct {
	_url        string
	Owner       string
	Repo        string
	RequestBody CreateTagReqBody
}
func (r *CreateTagReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/repos/%v/%v/git/tags", r.Owner, r.Repo),
	})
}
func (r *CreateTagReq) Rel(link string, resp *CreateTagResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateTagReqBodyTagger struct {
	Date *string `json:"date,omitempty"`
	Email *string `json:"email,omitempty"`
	Name *string `json:"name,omitempty"`
}
type CreateTagReqBody struct {
	Message *string `json:"message"`
	Object *string `json:"object"`
	Tag *string `json:"tag"`
	Tagger *CreateTagReqBodyTagger `json:"tagger,omitempty"`
	Type *string `json:"type"`
}
type CreateTagResponse struct {
	httpResponse *http.Response
	Data         components.GitTag
}
func (r *CreateTagResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateTagResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateTree(ctx context.Context, req *CreateTreeReq, opt ...requests.Option) (*CreateTreeResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateTreeReq)
	}
	resp := &CreateTreeResponse{}
	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) CreateTree(ctx context.Context, req *CreateTreeReq, opt ...requests.Option) (*CreateTreeResponse, error) {
	return CreateTree(ctx, req, append(c, opt...)...)
}
type CreateTreeReq struct {
	_url        string
	Owner       string
	Repo        string
	RequestBody CreateTreeReqBody
}
func (r *CreateTreeReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:  "POST",
		Options: opt,
		URLPath: fmt.Sprintf("/repos/%v/%v/git/trees", r.Owner, r.Repo),
	})
}
func (r *CreateTreeReq) Rel(link string, resp *CreateTreeResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateTreeReqBodyTree struct {
	Content *string `json:"content,omitempty"`
	Mode *string `json:"mode,omitempty"`
	Path *string `json:"path,omitempty"`
	Sha *string `json:"sha,omitempty"`
	Type *string `json:"type,omitempty"`
}
type CreateTreeReqBody struct {
	BaseTree *string `json:"base_tree,omitempty"`
	Tree []CreateTreeReqBodyTree `json:"tree"`
}
type CreateTreeResponse struct {
	httpResponse *http.Response
	Data         components.GitTree
}
func (r *CreateTreeResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateTreeResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func DeleteRef(ctx context.Context, req *DeleteRefReq, opt ...requests.Option) (*DeleteRefResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(DeleteRefReq)
	}
	resp := &DeleteRefResponse{}
	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
}