func CreateReview(ctx context.Context, req *CreateReviewReq, opt ...requests.Option) (*CreateReviewResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateReviewReq)
	}
	resp := &CreateReviewResponse{}
	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
}
/*
CreateReview performs requests for "pulls/create-review"

Create a review for a pull request.

POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews

https://developer.github.com/v3/pulls/reviews/#create-a-review-for-a-pull-request
package pulls
import (
	"context"
	"fmt"
	components "github.com/willabides/octo-go/components"
	requests "github.com/willabides/octo-go/requests"
	"net/http"
	"net/url"
	"strconv"
)
func CheckIfMerged(ctx context.Context, req *CheckIfMergedReq, opt ...requests.Option) (*CheckIfMergedResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CheckIfMergedReq)
	}
	resp := &CheckIfMergedResponse{}
	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) CheckIfMerged(ctx context.Context, req *CheckIfMergedReq, opt ...requests.Option) (*CheckIfMergedResponse, error) {
	return CheckIfMerged(ctx, req, append(c, opt...)...)
}
type CheckIfMergedReq struct {
	_url       string
	Owner      string
	Repo       string
	PullNumber int64
}
func (r *CheckIfMergedReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		ExplicitURL: r._url,
		Method:      "GET",
		Options:     opt,
		URLPath:     fmt.Sprintf("/repos/%v/%v/pulls/%v/merge", r.Owner, r.Repo, r.PullNumber),
	})
}
func (r *CheckIfMergedReq) Rel(link string, resp *CheckIfMergedResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CheckIfMergedResponse struct {
	httpResponse *http.Response
	Data         bool
}
func (r *CheckIfMergedResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CheckIfMergedResponse) 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 Create(ctx context.Context, req *CreateReq, opt ...requests.Option) (*CreateResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateReq)
	}
	resp := &CreateResponse{}
	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) Create(ctx context.Context, req *CreateReq, opt ...requests.Option) (*CreateResponse, error) {
	return Create(ctx, req, append(c, opt...)...)
}
type CreateReq struct {
	_url        string
	Owner       string
	Repo        string
	RequestBody CreateReqBody
	SailorVPreview bool
}
func (r *CreateReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error) {
	return buildHTTPRequest(ctx, buildHTTPRequestOptions{
		AllPreviews: []string{"sailor-v"},
		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{"sailor-v": r.SailorVPreview},
		URLPath:  fmt.Sprintf("/repos/%v/%v/pulls", r.Owner, r.Repo),
	})
}
func (r *CreateReq) Rel(link string, resp *CreateResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateReqBody struct {
	Base *string `json:"base"`
	Body *string `json:"body,omitempty"`
	Draft *bool `json:"draft,omitempty"`
	Head  *string `json:"head"`
	Issue *int64  `json:"issue,omitempty"`
	MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"`
	Title *string `json:"title,omitempty"`
}
type CreateResponse struct {
	httpResponse *http.Response
	Data         components.PullRequest
}
func (r *CreateResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateResponse) 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 CreateReplyForReviewComment(ctx context.Context, req *CreateReplyForReviewCommentReq, opt ...requests.Option) (*CreateReplyForReviewCommentResponse, error) {
	opts := requests.BuildOptions(opt...)
	if req == nil {
		req = new(CreateReplyForReviewCommentReq)
	}
	resp := &CreateReplyForReviewCommentResponse{}
	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) CreateReplyForReviewComment(ctx context.Context, req *CreateReplyForReviewCommentReq, opt ...requests.Option) (*CreateReplyForReviewCommentResponse, error) {
	return CreateReplyForReviewComment(ctx, req, append(c, opt...)...)
}
type CreateReplyForReviewCommentReq struct {
	_url       string
	Owner      string
	Repo       string
	PullNumber int64
	CommentId   int64
	RequestBody CreateReplyForReviewCommentReqBody
}
func (r *CreateReplyForReviewCommentReq) 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/pulls/%v/comments/%v/replies", r.Owner, r.Repo, r.PullNumber, r.CommentId),
	})
}
func (r *CreateReplyForReviewCommentReq) Rel(link string, resp *CreateReplyForReviewCommentResponse) bool {
	u := getRelLink(resp.HTTPResponse(), link)
	if u == "" {
		return false
	}
	r._url = u
	return true
}
type CreateReplyForReviewCommentReqBody struct {
	Body *string `json:"body"`
}
type CreateReplyForReviewCommentResponse struct {
	httpResponse *http.Response
	Data         components.PullRequestReviewComment
}
func (r *CreateReplyForReviewCommentResponse) HTTPResponse() *http.Response {
	return r.httpResponse
}
func (r *CreateReplyForReviewCommentResponse) 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
}