autogits/bots-common/gitea-generated/client/repository/repo_update_file_responses.go

403 lines
12 KiB
Go
Raw Normal View History

2024-07-07 21:08:41 +02:00
// 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 (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"src.opensuse.org/autogits/common/gitea-generated/models"
)
// RepoUpdateFileReader is a Reader for the RepoUpdateFile structure.
type RepoUpdateFileReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *RepoUpdateFileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewRepoUpdateFileOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewRepoUpdateFileForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewRepoUpdateFileNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewRepoUpdateFileUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 423:
result := NewRepoUpdateFileLocked()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[PUT /repos/{owner}/{repo}/contents/{filepath}] repoUpdateFile", response, response.Code())
}
}
// NewRepoUpdateFileOK creates a RepoUpdateFileOK with default headers values
func NewRepoUpdateFileOK() *RepoUpdateFileOK {
return &RepoUpdateFileOK{}
}
/*
RepoUpdateFileOK describes a response with status code 200, with default header values.
FileResponse
*/
type RepoUpdateFileOK struct {
Payload *models.FileResponse
}
// IsSuccess returns true when this repo update file o k response has a 2xx status code
func (o *RepoUpdateFileOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this repo update file o k response has a 3xx status code
func (o *RepoUpdateFileOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo update file o k response has a 4xx status code
func (o *RepoUpdateFileOK) IsClientError() bool {
return false
}
// IsServerError returns true when this repo update file o k response has a 5xx status code
func (o *RepoUpdateFileOK) IsServerError() bool {
return false
}
// IsCode returns true when this repo update file o k response a status code equal to that given
func (o *RepoUpdateFileOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the repo update file o k response
func (o *RepoUpdateFileOK) Code() int {
return 200
}
func (o *RepoUpdateFileOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileOK %s", 200, payload)
}
func (o *RepoUpdateFileOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileOK %s", 200, payload)
}
func (o *RepoUpdateFileOK) GetPayload() *models.FileResponse {
return o.Payload
}
func (o *RepoUpdateFileOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.FileResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewRepoUpdateFileForbidden creates a RepoUpdateFileForbidden with default headers values
func NewRepoUpdateFileForbidden() *RepoUpdateFileForbidden {
return &RepoUpdateFileForbidden{}
}
/*
RepoUpdateFileForbidden describes a response with status code 403, with default header values.
APIError is error format response
*/
type RepoUpdateFileForbidden struct {
Message string
URL string
}
// IsSuccess returns true when this repo update file forbidden response has a 2xx status code
func (o *RepoUpdateFileForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo update file forbidden response has a 3xx status code
func (o *RepoUpdateFileForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo update file forbidden response has a 4xx status code
func (o *RepoUpdateFileForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this repo update file forbidden response has a 5xx status code
func (o *RepoUpdateFileForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this repo update file forbidden response a status code equal to that given
func (o *RepoUpdateFileForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the repo update file forbidden response
func (o *RepoUpdateFileForbidden) Code() int {
return 403
}
func (o *RepoUpdateFileForbidden) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileForbidden", 403)
}
func (o *RepoUpdateFileForbidden) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileForbidden", 403)
}
func (o *RepoUpdateFileForbidden) 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
}
// NewRepoUpdateFileNotFound creates a RepoUpdateFileNotFound with default headers values
func NewRepoUpdateFileNotFound() *RepoUpdateFileNotFound {
return &RepoUpdateFileNotFound{}
}
/*
RepoUpdateFileNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type RepoUpdateFileNotFound struct {
}
// IsSuccess returns true when this repo update file not found response has a 2xx status code
func (o *RepoUpdateFileNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo update file not found response has a 3xx status code
func (o *RepoUpdateFileNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo update file not found response has a 4xx status code
func (o *RepoUpdateFileNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this repo update file not found response has a 5xx status code
func (o *RepoUpdateFileNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this repo update file not found response a status code equal to that given
func (o *RepoUpdateFileNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the repo update file not found response
func (o *RepoUpdateFileNotFound) Code() int {
return 404
}
func (o *RepoUpdateFileNotFound) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileNotFound", 404)
}
func (o *RepoUpdateFileNotFound) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileNotFound", 404)
}
func (o *RepoUpdateFileNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewRepoUpdateFileUnprocessableEntity creates a RepoUpdateFileUnprocessableEntity with default headers values
func NewRepoUpdateFileUnprocessableEntity() *RepoUpdateFileUnprocessableEntity {
return &RepoUpdateFileUnprocessableEntity{}
}
/*
RepoUpdateFileUnprocessableEntity describes a response with status code 422, with default header values.
APIError is error format response
*/
type RepoUpdateFileUnprocessableEntity struct {
Message string
URL string
}
// IsSuccess returns true when this repo update file unprocessable entity response has a 2xx status code
func (o *RepoUpdateFileUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo update file unprocessable entity response has a 3xx status code
func (o *RepoUpdateFileUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo update file unprocessable entity response has a 4xx status code
func (o *RepoUpdateFileUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this repo update file unprocessable entity response has a 5xx status code
func (o *RepoUpdateFileUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this repo update file unprocessable entity response a status code equal to that given
func (o *RepoUpdateFileUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the repo update file unprocessable entity response
func (o *RepoUpdateFileUnprocessableEntity) Code() int {
return 422
}
func (o *RepoUpdateFileUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileUnprocessableEntity", 422)
}
func (o *RepoUpdateFileUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileUnprocessableEntity", 422)
}
func (o *RepoUpdateFileUnprocessableEntity) 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
}
// NewRepoUpdateFileLocked creates a RepoUpdateFileLocked with default headers values
func NewRepoUpdateFileLocked() *RepoUpdateFileLocked {
return &RepoUpdateFileLocked{}
}
/*
RepoUpdateFileLocked describes a response with status code 423, with default header values.
APIRepoArchivedError is an error that is raised when an archived repo should be modified
*/
type RepoUpdateFileLocked struct {
Message string
URL string
}
// IsSuccess returns true when this repo update file locked response has a 2xx status code
func (o *RepoUpdateFileLocked) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo update file locked response has a 3xx status code
func (o *RepoUpdateFileLocked) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo update file locked response has a 4xx status code
func (o *RepoUpdateFileLocked) IsClientError() bool {
return true
}
// IsServerError returns true when this repo update file locked response has a 5xx status code
func (o *RepoUpdateFileLocked) IsServerError() bool {
return false
}
// IsCode returns true when this repo update file locked response a status code equal to that given
func (o *RepoUpdateFileLocked) IsCode(code int) bool {
return code == 423
}
// Code gets the status code for the repo update file locked response
func (o *RepoUpdateFileLocked) Code() int {
return 423
}
func (o *RepoUpdateFileLocked) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileLocked", 423)
}
func (o *RepoUpdateFileLocked) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/contents/{filepath}][%d] repoUpdateFileLocked", 423)
}
func (o *RepoUpdateFileLocked) 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
}