229 lines
7.4 KiB
Go
229 lines
7.4 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package repository
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// RepoMergePullRequestReader is a Reader for the RepoMergePullRequest structure.
|
|
type RepoMergePullRequestReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *RepoMergePullRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewRepoMergePullRequestOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 405:
|
|
result := NewRepoMergePullRequestMethodNotAllowed()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 409:
|
|
result := NewRepoMergePullRequestConflict()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewRepoMergePullRequestOK creates a RepoMergePullRequestOK with default headers values
|
|
func NewRepoMergePullRequestOK() *RepoMergePullRequestOK {
|
|
return &RepoMergePullRequestOK{}
|
|
}
|
|
|
|
/*
|
|
RepoMergePullRequestOK describes a response with status code 200, with default header values.
|
|
|
|
APIEmpty is an empty response
|
|
*/
|
|
type RepoMergePullRequestOK struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this repo merge pull request o k response has a 2xx status code
|
|
func (o *RepoMergePullRequestOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this repo merge pull request o k response has a 3xx status code
|
|
func (o *RepoMergePullRequestOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo merge pull request o k response has a 4xx status code
|
|
func (o *RepoMergePullRequestOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this repo merge pull request o k response has a 5xx status code
|
|
func (o *RepoMergePullRequestOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo merge pull request o k response a status code equal to that given
|
|
func (o *RepoMergePullRequestOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the repo merge pull request o k response
|
|
func (o *RepoMergePullRequestOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *RepoMergePullRequestOK) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoMergePullRequestOK ", 200)
|
|
}
|
|
|
|
func (o *RepoMergePullRequestOK) String() string {
|
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoMergePullRequestOK ", 200)
|
|
}
|
|
|
|
func (o *RepoMergePullRequestOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewRepoMergePullRequestMethodNotAllowed creates a RepoMergePullRequestMethodNotAllowed with default headers values
|
|
func NewRepoMergePullRequestMethodNotAllowed() *RepoMergePullRequestMethodNotAllowed {
|
|
return &RepoMergePullRequestMethodNotAllowed{}
|
|
}
|
|
|
|
/*
|
|
RepoMergePullRequestMethodNotAllowed describes a response with status code 405, with default header values.
|
|
|
|
APIEmpty is an empty response
|
|
*/
|
|
type RepoMergePullRequestMethodNotAllowed struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this repo merge pull request method not allowed response has a 2xx status code
|
|
func (o *RepoMergePullRequestMethodNotAllowed) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this repo merge pull request method not allowed response has a 3xx status code
|
|
func (o *RepoMergePullRequestMethodNotAllowed) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo merge pull request method not allowed response has a 4xx status code
|
|
func (o *RepoMergePullRequestMethodNotAllowed) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this repo merge pull request method not allowed response has a 5xx status code
|
|
func (o *RepoMergePullRequestMethodNotAllowed) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo merge pull request method not allowed response a status code equal to that given
|
|
func (o *RepoMergePullRequestMethodNotAllowed) IsCode(code int) bool {
|
|
return code == 405
|
|
}
|
|
|
|
// Code gets the status code for the repo merge pull request method not allowed response
|
|
func (o *RepoMergePullRequestMethodNotAllowed) Code() int {
|
|
return 405
|
|
}
|
|
|
|
func (o *RepoMergePullRequestMethodNotAllowed) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoMergePullRequestMethodNotAllowed ", 405)
|
|
}
|
|
|
|
func (o *RepoMergePullRequestMethodNotAllowed) String() string {
|
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoMergePullRequestMethodNotAllowed ", 405)
|
|
}
|
|
|
|
func (o *RepoMergePullRequestMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewRepoMergePullRequestConflict creates a RepoMergePullRequestConflict with default headers values
|
|
func NewRepoMergePullRequestConflict() *RepoMergePullRequestConflict {
|
|
return &RepoMergePullRequestConflict{}
|
|
}
|
|
|
|
/*
|
|
RepoMergePullRequestConflict describes a response with status code 409, with default header values.
|
|
|
|
APIError is error format response
|
|
*/
|
|
type RepoMergePullRequestConflict struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this repo merge pull request conflict response has a 2xx status code
|
|
func (o *RepoMergePullRequestConflict) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this repo merge pull request conflict response has a 3xx status code
|
|
func (o *RepoMergePullRequestConflict) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo merge pull request conflict response has a 4xx status code
|
|
func (o *RepoMergePullRequestConflict) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this repo merge pull request conflict response has a 5xx status code
|
|
func (o *RepoMergePullRequestConflict) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo merge pull request conflict response a status code equal to that given
|
|
func (o *RepoMergePullRequestConflict) IsCode(code int) bool {
|
|
return code == 409
|
|
}
|
|
|
|
// Code gets the status code for the repo merge pull request conflict response
|
|
func (o *RepoMergePullRequestConflict) Code() int {
|
|
return 409
|
|
}
|
|
|
|
func (o *RepoMergePullRequestConflict) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoMergePullRequestConflict ", 409)
|
|
}
|
|
|
|
func (o *RepoMergePullRequestConflict) String() string {
|
|
return fmt.Sprintf("[POST /repos/{owner}/{repo}/pulls/{index}/merge][%d] repoMergePullRequestConflict ", 409)
|
|
}
|
|
|
|
func (o *RepoMergePullRequestConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header message
|
|
hdrMessage := response.GetHeader("message")
|
|
|
|
if hdrMessage != "" {
|
|
o.Message = hdrMessage
|
|
}
|
|
|
|
// hydrates response header url
|
|
hdrURL := response.GetHeader("url")
|
|
|
|
if hdrURL != "" {
|
|
o.URL = hdrURL
|
|
}
|
|
|
|
return nil
|
|
}
|