307 lines
9.6 KiB
Go
307 lines
9.6 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"
|
|
)
|
|
|
|
// RepoUpdateBranchReader is a Reader for the RepoUpdateBranch structure.
|
|
type RepoUpdateBranchReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *RepoUpdateBranchReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 204:
|
|
result := NewRepoUpdateBranchNoContent()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 403:
|
|
result := NewRepoUpdateBranchForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewRepoUpdateBranchNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewRepoUpdateBranchUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[PATCH /repos/{owner}/{repo}/branches/{branch}] repoUpdateBranch", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewRepoUpdateBranchNoContent creates a RepoUpdateBranchNoContent with default headers values
|
|
func NewRepoUpdateBranchNoContent() *RepoUpdateBranchNoContent {
|
|
return &RepoUpdateBranchNoContent{}
|
|
}
|
|
|
|
/*
|
|
RepoUpdateBranchNoContent describes a response with status code 204, with default header values.
|
|
|
|
APIEmpty is an empty response
|
|
*/
|
|
type RepoUpdateBranchNoContent struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this repo update branch no content response has a 2xx status code
|
|
func (o *RepoUpdateBranchNoContent) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this repo update branch no content response has a 3xx status code
|
|
func (o *RepoUpdateBranchNoContent) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo update branch no content response has a 4xx status code
|
|
func (o *RepoUpdateBranchNoContent) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this repo update branch no content response has a 5xx status code
|
|
func (o *RepoUpdateBranchNoContent) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo update branch no content response a status code equal to that given
|
|
func (o *RepoUpdateBranchNoContent) IsCode(code int) bool {
|
|
return code == 204
|
|
}
|
|
|
|
// Code gets the status code for the repo update branch no content response
|
|
func (o *RepoUpdateBranchNoContent) Code() int {
|
|
return 204
|
|
}
|
|
|
|
func (o *RepoUpdateBranchNoContent) Error() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNoContent", 204)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchNoContent) String() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNoContent", 204)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewRepoUpdateBranchForbidden creates a RepoUpdateBranchForbidden with default headers values
|
|
func NewRepoUpdateBranchForbidden() *RepoUpdateBranchForbidden {
|
|
return &RepoUpdateBranchForbidden{}
|
|
}
|
|
|
|
/*
|
|
RepoUpdateBranchForbidden describes a response with status code 403, with default header values.
|
|
|
|
APIForbiddenError is a forbidden error response
|
|
*/
|
|
type RepoUpdateBranchForbidden struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this repo update branch forbidden response has a 2xx status code
|
|
func (o *RepoUpdateBranchForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this repo update branch forbidden response has a 3xx status code
|
|
func (o *RepoUpdateBranchForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo update branch forbidden response has a 4xx status code
|
|
func (o *RepoUpdateBranchForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this repo update branch forbidden response has a 5xx status code
|
|
func (o *RepoUpdateBranchForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo update branch forbidden response a status code equal to that given
|
|
func (o *RepoUpdateBranchForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the repo update branch forbidden response
|
|
func (o *RepoUpdateBranchForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *RepoUpdateBranchForbidden) Error() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchForbidden", 403)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchForbidden) String() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchForbidden", 403)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchForbidden) 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
|
|
}
|
|
|
|
// NewRepoUpdateBranchNotFound creates a RepoUpdateBranchNotFound with default headers values
|
|
func NewRepoUpdateBranchNotFound() *RepoUpdateBranchNotFound {
|
|
return &RepoUpdateBranchNotFound{}
|
|
}
|
|
|
|
/*
|
|
RepoUpdateBranchNotFound describes a response with status code 404, with default header values.
|
|
|
|
APINotFound is a not found empty response
|
|
*/
|
|
type RepoUpdateBranchNotFound struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this repo update branch not found response has a 2xx status code
|
|
func (o *RepoUpdateBranchNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this repo update branch not found response has a 3xx status code
|
|
func (o *RepoUpdateBranchNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo update branch not found response has a 4xx status code
|
|
func (o *RepoUpdateBranchNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this repo update branch not found response has a 5xx status code
|
|
func (o *RepoUpdateBranchNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo update branch not found response a status code equal to that given
|
|
func (o *RepoUpdateBranchNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the repo update branch not found response
|
|
func (o *RepoUpdateBranchNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *RepoUpdateBranchNotFound) Error() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNotFound", 404)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchNotFound) String() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchNotFound", 404)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewRepoUpdateBranchUnprocessableEntity creates a RepoUpdateBranchUnprocessableEntity with default headers values
|
|
func NewRepoUpdateBranchUnprocessableEntity() *RepoUpdateBranchUnprocessableEntity {
|
|
return &RepoUpdateBranchUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
RepoUpdateBranchUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
APIValidationError is error format response related to input validation
|
|
*/
|
|
type RepoUpdateBranchUnprocessableEntity struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this repo update branch unprocessable entity response has a 2xx status code
|
|
func (o *RepoUpdateBranchUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this repo update branch unprocessable entity response has a 3xx status code
|
|
func (o *RepoUpdateBranchUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this repo update branch unprocessable entity response has a 4xx status code
|
|
func (o *RepoUpdateBranchUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this repo update branch unprocessable entity response has a 5xx status code
|
|
func (o *RepoUpdateBranchUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this repo update branch unprocessable entity response a status code equal to that given
|
|
func (o *RepoUpdateBranchUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the repo update branch unprocessable entity response
|
|
func (o *RepoUpdateBranchUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *RepoUpdateBranchUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[PATCH /repos/{owner}/{repo}/branches/{branch}][%d] repoUpdateBranchUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *RepoUpdateBranchUnprocessableEntity) 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
|
|
}
|