func (c Client) DeleteInstallation(ctx context.Context, req *DeleteInstallationReq, opt ...requests.Option) (*DeleteInstallationResponse, error) {
	return DeleteInstallation(ctx, req, append(c, opt...)...)
}
/*
DeleteInstallation performs requests for "apps/delete-installation"

Delete an installation for the authenticated app.

DELETE /app/installations/{installation_id}

https://developer.github.com/v3/apps/#delete-an-installation-for-the-authenticated-app

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
package apps
import (
	"context"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func AddRepoToInstallation(ctx context.Context, req *AddRepoToInstallationReq, opt ...requests.Option) (*AddRepoToInstallationResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(AddRepoToInstallationReq)
	}
	resp := &AddRepoToInstallationResponse{}
	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) AddRepoToInstallation(ctx context.Context, req *AddRepoToInstallationReq, opt ...requests.Option) (*AddRepoToInstallationResponse, error) {
	return AddRepoToInstallation(ctx, req, append(c, opt...)...)
}
type AddRepoToInstallationReq struct {
	_url string
	InstallationId int64
	RepositoryId int64
	MachineManPreview bool
}
func (r *AddRepoToInstallationReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews:      []string{"machine-man"},
		ExplicitURL:      r._url,
		Method:           "PUT",
		Options:          opt,
		Previews:         map[string]bool{"machine-man": r.MachineManPreview},
		RequiredPreviews: []string{"machine-man"},
		URLPath:          fmt.Sprintf("/user/installations/%v/repositories/%v", r.InstallationId, r.RepositoryId),
	})
}
func (r *AddRepoToInstallationReq) Rel(link string, resp *AddRepoToInstallationResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type AddRepoToInstallationResponse struct {
	httpResponse *http.Response
}
func (r *AddRepoToInstallationResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *AddRepoToInstallationResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 304})
	if err != nil {
		return err
	}
	return nil
}
func CheckAuthorization(ctx context.Context, req *CheckAuthorizationReq, opt ...requests.Option) (*CheckAuthorizationResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CheckAuthorizationReq)
	}
	resp := &CheckAuthorizationResponse{}
	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) CheckAuthorization(ctx context.Context, req *CheckAuthorizationReq, opt ...requests.Option) (*CheckAuthorizationResponse, error) {
	return CheckAuthorization(ctx, req, append(c, opt...)...)
}
type CheckAuthorizationReq struct {
	_url        string
	ClientId    string
	AccessToken string
}
func (r *CheckAuthorizationReq) 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("/applications/%v/tokens/%v", r.ClientId, r.AccessToken),
	})
}
func (r *CheckAuthorizationReq) Rel(link string, resp *CheckAuthorizationResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CheckAuthorizationResponse struct {
	httpResponse *http.Response
	Data         components.Authorization
}
func (r *CheckAuthorizationResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CheckAuthorizationResponse) 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 CheckToken(ctx context.Context, req *CheckTokenReq, opt ...requests.Option) (*CheckTokenResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CheckTokenReq)
	}
	resp := &CheckTokenResponse{}
	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) CheckToken(ctx context.Context, req *CheckTokenReq, opt ...requests.Option) (*CheckTokenResponse, error) {
	return CheckToken(ctx, req, append(c, opt...)...)
}
type CheckTokenReq struct {
	_url        string
	ClientId    string
	RequestBody CheckTokenReqBody
}
func (r *CheckTokenReq) 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("/applications/%v/token", r.ClientId),
	})
}
func (r *CheckTokenReq) Rel(link string, resp *CheckTokenResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CheckTokenReqBody struct {
	AccessToken *string `json:"access_token"`
}
type CheckTokenResponse struct {
	httpResponse *http.Response
	Data         components.Authorization
}
func (r *CheckTokenResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CheckTokenResponse) 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 CreateContentAttachment(ctx context.Context, req *CreateContentAttachmentReq, opt ...requests.Option) (*CreateContentAttachmentResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateContentAttachmentReq)
	}
	resp := &CreateContentAttachmentResponse{}
	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) CreateContentAttachment(ctx context.Context, req *CreateContentAttachmentReq, opt ...requests.Option) (*CreateContentAttachmentResponse, error) {
	return CreateContentAttachment(ctx, req, append(c, opt...)...)
}
type CreateContentAttachmentReq struct {
	_url string
	ContentReferenceId int64
	RequestBody        CreateContentAttachmentReqBody
	CorsairPreview bool
}
func (r *CreateContentAttachmentReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"corsair"},
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:           "POST",
		Options:          opt,
		Previews:         map[string]bool{"corsair": r.CorsairPreview},
		RequiredPreviews: []string{"corsair"},
		URLPath:          fmt.Sprintf("/content_references/%v/attachments", r.ContentReferenceId),
	})
}
func (r *CreateContentAttachmentReq) Rel(link string, resp *CreateContentAttachmentResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateContentAttachmentReqBody struct {
	Body *string `json:"body"`
	Title *string `json:"title"`
}
type CreateContentAttachmentResponse struct {
	httpResponse *http.Response
	Data         components.ContentReferenceAttachment
}
func (r *CreateContentAttachmentResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateContentAttachmentResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{200, 304})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{200}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateFromManifest(ctx context.Context, req *CreateFromManifestReq, opt ...requests.Option) (*CreateFromManifestResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateFromManifestReq)
	}
	resp := &CreateFromManifestResponse{}
	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) CreateFromManifest(ctx context.Context, req *CreateFromManifestReq, opt ...requests.Option) (*CreateFromManifestResponse, error) {
	return CreateFromManifest(ctx, req, append(c, opt...)...)
}
type CreateFromManifestReq struct {
	_url string
	Code string
}
func (r *CreateFromManifestReq) 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:      "POST",
		Options:     opt,
		URLPath:     fmt.Sprintf("/app-manifests/%v/conversions", r.Code),
	})
}
func (r *CreateFromManifestReq) Rel(link string, resp *CreateFromManifestResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateFromManifestResponseBody struct {
	ClientId     string `json:"client_id,omitempty"`
	ClientSecret string `json:"client_secret,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	Description  string `json:"description,omitempty"`
	Events      []string `json:"events,omitempty"`
	ExternalUrl string   `json:"external_url,omitempty"`
	HtmlUrl     string   `json:"html_url,omitempty"`
	Id int64 `json:"id,omitempty"`
	InstallationsCount int64 `json:"installations_count,omitempty"`
	Name   string                `json:"name,omitempty"`
	NodeId string                `json:"node_id,omitempty"`
	Owner  components.SimpleUser `json:"owner,omitempty"`
	Pem    string                `json:"pem,omitempty"`
	Permissions map[string]string `json:"permissions,omitempty"`
	Slug          string `json:"slug,omitempty"`
	UpdatedAt     string `json:"updated_at,omitempty"`
	WebhookSecret string `json:"webhook_secret,omitempty"`
}
type CreateFromManifestResponse struct {
	httpResponse *http.Response
	Data         CreateFromManifestResponseBody
}
func (r *CreateFromManifestResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateFromManifestResponse) 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 CreateInstallationAccessToken(ctx context.Context, req *CreateInstallationAccessTokenReq, opt ...requests.Option) (*CreateInstallationAccessTokenResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateInstallationAccessTokenReq)
	}
	resp := &CreateInstallationAccessTokenResponse{}
	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) CreateInstallationAccessToken(ctx context.Context, req *CreateInstallationAccessTokenReq, opt ...requests.Option) (*CreateInstallationAccessTokenResponse, error) {
	return CreateInstallationAccessToken(ctx, req, append(c, opt...)...)
}
type CreateInstallationAccessTokenReq struct {
	_url string
	InstallationId int64
	RequestBody    CreateInstallationAccessTokenReqBody
	MachineManPreview bool
}
func (r *CreateInstallationAccessTokenReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"machine-man"},
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals: map[string]*string{
			"accept":       strPtr("application/json"),
			"content-type": strPtr("application/json"),
		},
		Method:           "POST",
		Options:          opt,
		Previews:         map[string]bool{"machine-man": r.MachineManPreview},
		RequiredPreviews: []string{"machine-man"},
		URLPath:          fmt.Sprintf("/app/installations/%v/access_tokens", r.InstallationId),
	})
}
func (r *CreateInstallationAccessTokenReq) Rel(link string, resp *CreateInstallationAccessTokenResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateInstallationAccessTokenReqBodyPermissions map[string]string
type CreateInstallationAccessTokenReqBody struct {
	Permissions map[string]string `json:"permissions,omitempty"`
	Repositories []string `json:"repositories,omitempty"`
	RepositoryIds []int64 `json:"repository_ids,omitempty"`
}
type CreateInstallationAccessTokenResponse struct {
	httpResponse *http.Response
	Data         components.InstallationToken
}
func (r *CreateInstallationAccessTokenResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateInstallationAccessTokenResponse) 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 DeleteAuthorization(ctx context.Context, req *DeleteAuthorizationReq, opt ...requests.Option) (*DeleteAuthorizationResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(DeleteAuthorizationReq)
	}
	resp := &DeleteAuthorizationResponse{}
	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) DeleteAuthorization(ctx context.Context, req *DeleteAuthorizationReq, opt ...requests.Option) (*DeleteAuthorizationResponse, error) {
	return DeleteAuthorization(ctx, req, append(c, opt...)...)
}
type DeleteAuthorizationReq struct {
	_url        string
	ClientId    string
	RequestBody DeleteAuthorizationReqBody
}
func (r *DeleteAuthorizationReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		Body:        r.RequestBody,
		ExplicitURL: r._url,
		HeaderVals:  map[string]*string{"content-type": strPtr("application/json")},
		Method:      "DELETE",
		Options:     opt,
		URLPath:     fmt.Sprintf("/applications/%v/grant", r.ClientId),
	})
}
func (r *DeleteAuthorizationReq) Rel(link string, resp *DeleteAuthorizationResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type DeleteAuthorizationReqBody struct {
	AccessToken *string `json:"access_token,omitempty"`
}
type DeleteAuthorizationResponse struct {
	httpResponse *http.Response
}
func (r *DeleteAuthorizationResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *DeleteAuthorizationResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204})
	if err != nil {
		return err
	}
	return nil
}
func DeleteInstallation(ctx context.Context, req *DeleteInstallationReq, opt ...requests.Option) (*DeleteInstallationResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(DeleteInstallationReq)
	}
	resp := &DeleteInstallationResponse{}
	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
}