func (s *MergeRequestsService) CancelMergeWhenPipelineSucceeds(pid interface{}, mergeRequest int, options ...RequestOptionFunc) (*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/cancel_merge_when_pipeline_succeeds", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodPost, u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	m := new(MergeRequest)
	resp, err := s.client.Do(req, m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
CancelMergeWhenPipelineSucceeds cancels a merge when pipeline succeeds. If
you don't have permissions to accept this merge request - you'll get a 401.
If the merge request is already merged or closed - you get 405 and error
message 'Method Not Allowed'. In case the merge request is not set to be
merged when the pipeline succeeds, you'll also get a 406 error.

GitLab API docs:
https://docs.gitlab.com/ce/api/merge_requests.html#cancel-merge-when-pipeline-succeeds
package gitlab
import (
	"fmt"
	"net/http"
	"time"
)
type MergeRequestsService struct {
	client    *Client
	timeStats *timeStatsService
}
type MergeRequest struct {
	ID                        int          `json:"id"`
	IID                       int          `json:"iid"`
	TargetBranch              string       `json:"target_branch"`
	SourceBranch              string       `json:"source_branch"`
	ProjectID                 int          `json:"project_id"`
	Title                     string       `json:"title"`
	State                     string       `json:"state"`
	CreatedAt                 *time.Time   `json:"created_at"`
	UpdatedAt                 *time.Time   `json:"updated_at"`
	Upvotes                   int          `json:"upvotes"`
	Downvotes                 int          `json:"downvotes"`
	Author                    *BasicUser   `json:"author"`
	Assignee                  *BasicUser   `json:"assignee"`
	Assignees                 []*BasicUser `json:"assignees"`
	Reviewers                 []*BasicUser `json:"reviewers"`
	SourceProjectID           int          `json:"source_project_id"`
	TargetProjectID           int          `json:"target_project_id"`
	Labels                    Labels       `json:"labels"`
	Description               string       `json:"description"`
	WorkInProgress            bool         `json:"work_in_progress"`
	Milestone                 *Milestone   `json:"milestone"`
	MergeWhenPipelineSucceeds bool         `json:"merge_when_pipeline_succeeds"`
	MergeStatus               string       `json:"merge_status"`
	MergeError                string       `json:"merge_error"`
	MergedBy                  *BasicUser   `json:"merged_by"`
	MergedAt                  *time.Time   `json:"merged_at"`
	ClosedBy                  *BasicUser   `json:"closed_by"`
	ClosedAt                  *time.Time   `json:"closed_at"`
	Subscribed                bool         `json:"subscribed"`
	SHA                       string       `json:"sha"`
	MergeCommitSHA            string       `json:"merge_commit_sha"`
	SquashCommitSHA           string       `json:"squash_commit_sha"`
	UserNotesCount            int          `json:"user_notes_count"`
	ChangesCount              string       `json:"changes_count"`
	ShouldRemoveSourceBranch  bool         `json:"should_remove_source_branch"`
	ForceRemoveSourceBranch   bool         `json:"force_remove_source_branch"`
	AllowCollaboration        bool         `json:"allow_collaboration"`
	WebURL                    string       `json:"web_url"`
	DiscussionLocked          bool         `json:"discussion_locked"`
	Changes                   []struct {
		OldPath     string `json:"old_path"`
		NewPath     string `json:"new_path"`
		AMode       string `json:"a_mode"`
		BMode       string `json:"b_mode"`
		Diff        string `json:"diff"`
		NewFile     bool   `json:"new_file"`
		RenamedFile bool   `json:"renamed_file"`
		DeletedFile bool   `json:"deleted_file"`
	} `json:"changes"`
	User struct {
		CanMerge bool `json:"can_merge"`
	} `json:"user"`
	TimeStats    *TimeStats    `json:"time_stats"`
	Squash       bool          `json:"squash"`
	Pipeline     *PipelineInfo `json:"pipeline"`
	HeadPipeline *Pipeline     `json:"head_pipeline"`
	DiffRefs     struct {
		BaseSha  string `json:"base_sha"`
		HeadSha  string `json:"head_sha"`
		StartSha string `json:"start_sha"`
	} `json:"diff_refs"`
	DivergedCommitsCount        int                    `json:"diverged_commits_count"`
	RebaseInProgress            bool                   `json:"rebase_in_progress"`
	ApprovalsBeforeMerge        int                    `json:"approvals_before_merge"`
	Reference                   string                 `json:"reference"`
	FirstContribution           bool                   `json:"first_contribution"`
	TaskCompletionStatus        *TasksCompletionStatus `json:"task_completion_status"`
	HasConflicts                bool                   `json:"has_conflicts"`
	BlockingDiscussionsResolved bool                   `json:"blocking_discussions_resolved"`
	Overflow                    bool                   `json:"overflow"`
}
func (m MergeRequest) String() string {
	return Stringify(m)
}
type MergeRequestDiffVersion struct {
	ID             int        `json:"id"`
	HeadCommitSHA  string     `json:"head_commit_sha,omitempty"`
	BaseCommitSHA  string     `json:"base_commit_sha,omitempty"`
	StartCommitSHA string     `json:"start_commit_sha,omitempty"`
	CreatedAt      *time.Time `json:"created_at,omitempty"`
	MergeRequestID int        `json:"merge_request_id,omitempty"`
	State          string     `json:"state,omitempty"`
	RealSize       string     `json:"real_size,omitempty"`
	Commits        []*Commit  `json:"commits,omitempty"`
	Diffs          []*Diff    `json:"diffs,omitempty"`
}
func (m MergeRequestDiffVersion) String() string {
	return Stringify(m)
}
type ListMergeRequestsOptions struct {
	ListOptions
	State                  *string    `url:"state,omitempty" json:"state,omitempty"`
	OrderBy                *string    `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort                   *string    `url:"sort,omitempty" json:"sort,omitempty"`
	Milestone              *string    `url:"milestone,omitempty" json:"milestone,omitempty"`
	View                   *string    `url:"view,omitempty" json:"view,omitempty"`
	Labels                 Labels     `url:"labels,comma,omitempty" json:"labels,omitempty"`
	NotLabels              Labels     `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
	WithLabelsDetails      *bool      `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
	WithMergeStatusRecheck *bool      `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
	CreatedAfter           *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
	CreatedBefore          *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
	UpdatedAfter           *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
	UpdatedBefore          *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
	Scope                  *string    `url:"scope,omitempty" json:"scope,omitempty"`
	AuthorID               *int       `url:"author_id,omitempty" json:"author_id,omitempty"`
	AssigneeID             *int       `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	ReviewerID             *int       `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
	ReviewerUsername       *string    `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
	MyReactionEmoji        *string    `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
	SourceBranch           *string    `url:"source_branch,omitempty" json:"source_branch,omitempty"`
	TargetBranch           *string    `url:"target_branch,omitempty" json:"target_branch,omitempty"`
	Search                 *string    `url:"search,omitempty" json:"search,omitempty"`
	In                     *string    `url:"in,omitempty" json:"in,omitempty"`
	WIP                    *string    `url:"wip,omitempty" json:"wip,omitempty"`
}
func (s *MergeRequestsService) ListMergeRequests(opt *ListMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) {
	req, err := s.client.NewRequest(http.MethodGet, "merge_requests", opt, options)
	if err != nil {
		return nil, nil, err
	}
	var m []*MergeRequest
	resp, err := s.client.Do(req, &m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
type ListGroupMergeRequestsOptions struct {
	ListOptions
	State                  *string    `url:"state,omitempty" json:"state,omitempty"`
	OrderBy                *string    `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort                   *string    `url:"sort,omitempty" json:"sort,omitempty"`
	Milestone              *string    `url:"milestone,omitempty" json:"milestone,omitempty"`
	View                   *string    `url:"view,omitempty" json:"view,omitempty"`
	Labels                 Labels     `url:"labels,comma,omitempty" json:"labels,omitempty"`
	NotLabels              Labels     `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
	WithLabelsDetails      *bool      `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
	WithMergeStatusRecheck *bool      `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
	CreatedAfter           *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
	CreatedBefore          *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
	UpdatedAfter           *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
	UpdatedBefore          *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
	Scope                  *string    `url:"scope,omitempty" json:"scope,omitempty"`
	AuthorID               *int       `url:"author_id,omitempty" json:"author_id,omitempty"`
	AssigneeID             *int       `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	ReviewerID             *int       `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
	ReviewerUsername       *string    `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
	MyReactionEmoji        *string    `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
	SourceBranch           *string    `url:"source_branch,omitempty" json:"source_branch,omitempty"`
	TargetBranch           *string    `url:"target_branch,omitempty" json:"target_branch,omitempty"`
	Search                 *string    `url:"search,omitempty" json:"search,omitempty"`
	In                     *string    `url:"in,omitempty" json:"in,omitempty"`
	WIP                    *string    `url:"wip,omitempty" json:"wip,omitempty"`
}
func (s *MergeRequestsService) ListGroupMergeRequests(gid interface{}, opt *ListGroupMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) {
	group, err := parseID(gid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("groups/%s/merge_requests", pathEscape(group))
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	var m []*MergeRequest
	resp, err := s.client.Do(req, &m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
type ListProjectMergeRequestsOptions struct {
	ListOptions
	IIDs                   []int      `url:"iids[],omitempty" json:"iids,omitempty"`
	State                  *string    `url:"state,omitempty" json:"state,omitempty"`
	OrderBy                *string    `url:"order_by,omitempty" json:"order_by,omitempty"`
	Sort                   *string    `url:"sort,omitempty" json:"sort,omitempty"`
	Milestone              *string    `url:"milestone,omitempty" json:"milestone,omitempty"`
	View                   *string    `url:"view,omitempty" json:"view,omitempty"`
	Labels                 Labels     `url:"labels,comma,omitempty" json:"labels,omitempty"`
	NotLabels              Labels     `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
	WithLabelsDetails      *bool      `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
	WithMergeStatusRecheck *bool      `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,omitempty"`
	CreatedAfter           *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
	CreatedBefore          *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
	UpdatedAfter           *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
	UpdatedBefore          *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
	Scope                  *string    `url:"scope,omitempty" json:"scope,omitempty"`
	AuthorID               *int       `url:"author_id,omitempty" json:"author_id,omitempty"`
	AssigneeID             *int       `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	ReviewerID             *int       `url:"reviewer_id,omitempty" json:"reviewer_id,omitempty"`
	ReviewerUsername       *string    `url:"reviewer_username,omitempty" json:"reviewer_username,omitempty"`
	MyReactionEmoji        *string    `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
	SourceBranch           *string    `url:"source_branch,omitempty" json:"source_branch,omitempty"`
	TargetBranch           *string    `url:"target_branch,omitempty" json:"target_branch,omitempty"`
	Search                 *string    `url:"search,omitempty" json:"search,omitempty"`
	WIP                    *string    `url:"wip,omitempty" json:"wip,omitempty"`
}
func (s *MergeRequestsService) ListProjectMergeRequests(pid interface{}, opt *ListProjectMergeRequestsOptions, options ...RequestOptionFunc) ([]*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests", pathEscape(project))
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	var m []*MergeRequest
	resp, err := s.client.Do(req, &m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
type GetMergeRequestsOptions struct {
	RenderHTML                  *bool `url:"render_html,omitempty" json:"render_html,omitempty"`
	IncludeDivergedCommitsCount *bool `url:"include_diverged_commits_count,omitempty" json:"include_diverged_commits_count,omitempty"`
	IncludeRebaseInProgress     *bool `url:"include_rebase_in_progress,omitempty" json:"include_rebase_in_progress,omitempty"`
}
func (s *MergeRequestsService) GetMergeRequest(pid interface{}, mergeRequest int, opt *GetMergeRequestsOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	m := new(MergeRequest)
	resp, err := s.client.Do(req, m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
func (s *MergeRequestsService) GetMergeRequestApprovals(pid interface{}, mergeRequest int, options ...RequestOptionFunc) (*MergeRequestApprovals, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/approvals", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	a := new(MergeRequestApprovals)
	resp, err := s.client.Do(req, a)
	if err != nil {
		return nil, resp, err
	}
	return a, resp, err
}
type GetMergeRequestCommitsOptions ListOptions
func (s *MergeRequestsService) GetMergeRequestCommits(pid interface{}, mergeRequest int, opt *GetMergeRequestCommitsOptions, options ...RequestOptionFunc) ([]*Commit, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/commits", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	var c []*Commit
	resp, err := s.client.Do(req, &c)
	if err != nil {
		return nil, resp, err
	}
	return c, resp, err
}
type GetMergeRequestChangesOptions struct {
	AccessRawDiffs *bool `url:"access_raw_diffs,omitempty" json:"access_raw_diffs,omitempty"`
}
func (s *MergeRequestsService) GetMergeRequestChanges(pid interface{}, mergeRequest int, opt *GetMergeRequestChangesOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/changes", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	m := new(MergeRequest)
	resp, err := s.client.Do(req, m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
func (s *MergeRequestsService) GetMergeRequestParticipants(pid interface{}, mergeRequest int, options ...RequestOptionFunc) ([]*BasicUser, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/participants", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	var ps []*BasicUser
	resp, err := s.client.Do(req, &ps)
	if err != nil {
		return nil, resp, err
	}
	return ps, resp, err
}
func (s *MergeRequestsService) ListMergeRequestPipelines(pid interface{}, mergeRequest int, options ...RequestOptionFunc) ([]*PipelineInfo, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/pipelines", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	var p []*PipelineInfo
	resp, err := s.client.Do(req, &p)
	if err != nil {
		return nil, resp, err
	}
	return p, resp, err
}
func (s *MergeRequestsService) CreateMergeRequestPipeline(pid interface{}, mergeRequest int, options ...RequestOptionFunc) (*PipelineInfo, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/pipelines", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodPost, u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	p := new(PipelineInfo)
	resp, err := s.client.Do(req, p)
	if err != nil {
		return nil, resp, err
	}
	return p, resp, err
}
type GetIssuesClosedOnMergeOptions ListOptions
func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid interface{}, mergeRequest int, opt *GetIssuesClosedOnMergeOptions, options ...RequestOptionFunc) ([]*Issue, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/closes_issues", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	var i []*Issue
	resp, err := s.client.Do(req, &i)
	if err != nil {
		return nil, resp, err
	}
	return i, resp, err
}
type CreateMergeRequestOptions struct {
	Title              *string `url:"title,omitempty" json:"title,omitempty"`
	Description        *string `url:"description,omitempty" json:"description,omitempty"`
	SourceBranch       *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
	TargetBranch       *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
	Labels             Labels  `url:"labels,comma,omitempty" json:"labels,omitempty"`
	AssigneeID         *int    `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	AssigneeIDs        []int   `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
	ReviewerIDs        []int   `url:"reviewer_ids,omitempty" json:"reviewer_ids,omitempty"`
	TargetProjectID    *int    `url:"target_project_id,omitempty" json:"target_project_id,omitempty"`
	MilestoneID        *int    `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
	RemoveSourceBranch *bool   `url:"remove_source_branch,omitempty" json:"remove_source_branch,omitempty"`
	Squash             *bool   `url:"squash,omitempty" json:"squash,omitempty"`
	AllowCollaboration *bool   `url:"allow_collaboration,omitempty" json:"allow_collaboration,omitempty"`
}
func (s *MergeRequestsService) CreateMergeRequest(pid interface{}, opt *CreateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests", pathEscape(project))
	req, err := s.client.NewRequest(http.MethodPost, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	m := new(MergeRequest)
	resp, err := s.client.Do(req, m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
type UpdateMergeRequestOptions struct {
	Title              *string `url:"title,omitempty" json:"title,omitempty"`
	Description        *string `url:"description,omitempty" json:"description,omitempty"`
	TargetBranch       *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
	AssigneeID         *int    `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
	AssigneeIDs        []int   `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
	ReviewerIDs        []int   `url:"reviewer_ids,omitempty" json:"reviewer_ids,omitempty"`
	Labels             Labels  `url:"labels,comma,omitempty" json:"labels,omitempty"`
	AddLabels          Labels  `url:"add_labels,comma,omitempty" json:"add_labels,omitempty"`
	RemoveLabels       Labels  `url:"remove_labels,comma,omitempty" json:"remove_labels,omitempty"`
	MilestoneID        *int    `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
	StateEvent         *string `url:"state_event,omitempty" json:"state_event,omitempty"`
	RemoveSourceBranch *bool   `url:"remove_source_branch,omitempty" json:"remove_source_branch,omitempty"`
	Squash             *bool   `url:"squash,omitempty" json:"squash,omitempty"`
	DiscussionLocked   *bool   `url:"discussion_locked,omitempty" json:"discussion_locked,omitempty"`
	AllowCollaboration *bool   `url:"allow_collaboration,omitempty" json:"allow_collaboration,omitempty"`
}
func (s *MergeRequestsService) UpdateMergeRequest(pid interface{}, mergeRequest int, opt *UpdateMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodPut, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	m := new(MergeRequest)
	resp, err := s.client.Do(req, m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}
func (s *MergeRequestsService) DeleteMergeRequest(pid interface{}, mergeRequest int, options ...RequestOptionFunc) (*Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
	if err != nil {
		return nil, err
	}
	return s.client.Do(req, nil)
}
type AcceptMergeRequestOptions struct {
	MergeCommitMessage        *string `url:"merge_commit_message,omitempty" json:"merge_commit_message,omitempty"`
	SquashCommitMessage       *string `url:"squash_commit_message,omitempty" json:"squash_commit_message,omitempty"`
	Squash                    *bool   `url:"squash,omitempty" json:"squash,omitempty"`
	ShouldRemoveSourceBranch  *bool   `url:"should_remove_source_branch,omitempty" json:"should_remove_source_branch,omitempty"`
	MergeWhenPipelineSucceeds *bool   `url:"merge_when_pipeline_succeeds,omitempty" json:"merge_when_pipeline_succeeds,omitempty"`
	SHA                       *string `url:"sha,omitempty" json:"sha,omitempty"`
}
func (s *MergeRequestsService) AcceptMergeRequest(pid interface{}, mergeRequest int, opt *AcceptMergeRequestOptions, options ...RequestOptionFunc) (*MergeRequest, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/merge_requests/%d/merge", pathEscape(project), mergeRequest)
	req, err := s.client.NewRequest(http.MethodPut, u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	m := new(MergeRequest)
	resp, err := s.client.Do(req, m)
	if err != nil {
		return nil, resp, err
	}
	return m, resp, err
}