func (r *CreateForOrgResponse) 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
}
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
package projects
import (
	"context"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func AddCollaborator(ctx context.Context, req *AddCollaboratorReq, opt ...requests.Option) (*AddCollaboratorResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(AddCollaboratorReq)
	}
	resp := &AddCollaboratorResponse{}
	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) AddCollaborator(ctx context.Context, req *AddCollaboratorReq, opt ...requests.Option) (*AddCollaboratorResponse, error) {
	return AddCollaborator(ctx, req, append(c, opt...)...)
}
type AddCollaboratorReq struct {
	_url        string
	ProjectId   int64
	Username    string
	RequestBody AddCollaboratorReqBody
	InertiaPreview bool
}
func (r *AddCollaboratorReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews:      []string{"inertia"},
		Body:             r.RequestBody,
		ExplicitURL:      r._url,
		HeaderVals:       map[string]*string{"content-type": strPtr("application/json")},
		Method:           "PUT",
		Options:          opt,
		Previews:         map[string]bool{"inertia": r.InertiaPreview},
		RequiredPreviews: []string{"inertia"},
		URLPath:          fmt.Sprintf("/projects/%v/collaborators/%v", r.ProjectId, r.Username),
	})
}
func (r *AddCollaboratorReq) Rel(link string, resp *AddCollaboratorResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type AddCollaboratorReqBody struct {
	Permission *string `json:"permission,omitempty"`
}
type AddCollaboratorResponse struct {
	httpResponse *http.Response
}
func (r *AddCollaboratorResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *AddCollaboratorResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{204, 304})
	if err != nil {
		return err
	}
	return nil
}
func CreateCard(ctx context.Context, req *CreateCardReq, opt ...requests.Option) (*CreateCardResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateCardReq)
	}
	resp := &CreateCardResponse{}
	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) CreateCard(ctx context.Context, req *CreateCardReq, opt ...requests.Option) (*CreateCardResponse, error) {
	return CreateCard(ctx, req, append(c, opt...)...)
}
type CreateCardReq struct {
	_url string
	ColumnId    int64
	RequestBody CreateCardReqBody
	InertiaPreview bool
}
func (r *CreateCardReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"inertia"},
		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{"inertia": r.InertiaPreview},
		RequiredPreviews: []string{"inertia"},
		URLPath:          fmt.Sprintf("/projects/columns/%v/cards", r.ColumnId),
	})
}
func (r *CreateCardReq) Rel(link string, resp *CreateCardResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateCardReqBody struct {
	ContentId *int64 `json:"content_id"`
	ContentType *string `json:"content_type"`
}
type CreateCardResponse struct {
	httpResponse *http.Response
	Data         components.ProjectCard
}
func (r *CreateCardResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateCardResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201, 304})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateColumn(ctx context.Context, req *CreateColumnReq, opt ...requests.Option) (*CreateColumnResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateColumnReq)
	}
	resp := &CreateColumnResponse{}
	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) CreateColumn(ctx context.Context, req *CreateColumnReq, opt ...requests.Option) (*CreateColumnResponse, error) {
	return CreateColumn(ctx, req, append(c, opt...)...)
}
type CreateColumnReq struct {
	_url        string
	ProjectId   int64
	RequestBody CreateColumnReqBody
	InertiaPreview bool
}
func (r *CreateColumnReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"inertia"},
		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{"inertia": r.InertiaPreview},
		RequiredPreviews: []string{"inertia"},
		URLPath:          fmt.Sprintf("/projects/%v/columns", r.ProjectId),
	})
}
func (r *CreateColumnReq) Rel(link string, resp *CreateColumnResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateColumnReqBody struct {
	Name *string `json:"name"`
}
type CreateColumnResponse struct {
	httpResponse *http.Response
	Data         components.ProjectColumn
}
func (r *CreateColumnResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateColumnResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201, 304})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateForAuthenticatedUser(ctx context.Context, req *CreateForAuthenticatedUserReq, opt ...requests.Option) (*CreateForAuthenticatedUserResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateForAuthenticatedUserReq)
	}
	resp := &CreateForAuthenticatedUserResponse{}
	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) CreateForAuthenticatedUser(ctx context.Context, req *CreateForAuthenticatedUserReq, opt ...requests.Option) (*CreateForAuthenticatedUserResponse, error) {
	return CreateForAuthenticatedUser(ctx, req, append(c, opt...)...)
}
type CreateForAuthenticatedUserReq struct {
	_url        string
	RequestBody CreateForAuthenticatedUserReqBody
	InertiaPreview bool
}
func (r *CreateForAuthenticatedUserReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"inertia"},
		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{"inertia": r.InertiaPreview},
		RequiredPreviews: []string{"inertia"},
		URLPath:          fmt.Sprintf("/user/projects"),
	})
}
func (r *CreateForAuthenticatedUserReq) Rel(link string, resp *CreateForAuthenticatedUserResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateForAuthenticatedUserReqBody struct {
	Body *string `json:"body,omitempty"`
	Name *string `json:"name"`
}
type CreateForAuthenticatedUserResponse struct {
	httpResponse *http.Response
	Data         components.Project
}
func (r *CreateForAuthenticatedUserResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateForAuthenticatedUserResponse) ReadResponse(resp *http.Response) error {
	r.httpResponse = resp
	err := responseErrorCheck(resp, []int{201, 304})
	if err != nil {
		return err
	}
	if intInSlice(resp.StatusCode, []int{201}) {
		err = unmarshalResponseBody(resp, &r.Data)
		if err != nil {
			return err
		}
	}
	return nil
}
func CreateForOrg(ctx context.Context, req *CreateForOrgReq, opt ...requests.Option) (*CreateForOrgResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateForOrgReq)
	}
	resp := &CreateForOrgResponse{}
	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) CreateForOrg(ctx context.Context, req *CreateForOrgReq, opt ...requests.Option) (*CreateForOrgResponse, error) {
	return CreateForOrg(ctx, req, append(c, opt...)...)
}
type CreateForOrgReq struct {
	_url        string
	Org         string
	RequestBody CreateForOrgReqBody
	InertiaPreview bool
}
func (r *CreateForOrgReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"inertia"},
		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{"inertia": r.InertiaPreview},
		RequiredPreviews: []string{"inertia"},
		URLPath:          fmt.Sprintf("/orgs/%v/projects", r.Org),
	})
}
func (r *CreateForOrgReq) Rel(link string, resp *CreateForOrgResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateForOrgReqBody struct {
	Body *string `json:"body,omitempty"`
	Name *string `json:"name"`
}
type CreateForOrgResponse struct {
	httpResponse *http.Response
	Data         components.Project
}
func (r *CreateForOrgResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}