387 lines
12 KiB
Go
387 lines
12 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 (
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
|
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
|
)
|
|
|
|
// GenerateRepoReader is a Reader for the GenerateRepo structure.
|
|
type GenerateRepoReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GenerateRepoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 201:
|
|
result := NewGenerateRepoCreated()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 403:
|
|
result := NewGenerateRepoForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGenerateRepoNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 409:
|
|
result := NewGenerateRepoConflict()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewGenerateRepoUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[POST /repos/{template_owner}/{template_repo}/generate] generateRepo", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGenerateRepoCreated creates a GenerateRepoCreated with default headers values
|
|
func NewGenerateRepoCreated() *GenerateRepoCreated {
|
|
return &GenerateRepoCreated{}
|
|
}
|
|
|
|
/*
|
|
GenerateRepoCreated describes a response with status code 201, with default header values.
|
|
|
|
Repository
|
|
*/
|
|
type GenerateRepoCreated struct {
|
|
Payload *models.Repository
|
|
}
|
|
|
|
// IsSuccess returns true when this generate repo created response has a 2xx status code
|
|
func (o *GenerateRepoCreated) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this generate repo created response has a 3xx status code
|
|
func (o *GenerateRepoCreated) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this generate repo created response has a 4xx status code
|
|
func (o *GenerateRepoCreated) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this generate repo created response has a 5xx status code
|
|
func (o *GenerateRepoCreated) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this generate repo created response a status code equal to that given
|
|
func (o *GenerateRepoCreated) IsCode(code int) bool {
|
|
return code == 201
|
|
}
|
|
|
|
// Code gets the status code for the generate repo created response
|
|
func (o *GenerateRepoCreated) Code() int {
|
|
return 201
|
|
}
|
|
|
|
func (o *GenerateRepoCreated) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoCreated %s", 201, payload)
|
|
}
|
|
|
|
func (o *GenerateRepoCreated) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoCreated %s", 201, payload)
|
|
}
|
|
|
|
func (o *GenerateRepoCreated) GetPayload() *models.Repository {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GenerateRepoCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(models.Repository)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGenerateRepoForbidden creates a GenerateRepoForbidden with default headers values
|
|
func NewGenerateRepoForbidden() *GenerateRepoForbidden {
|
|
return &GenerateRepoForbidden{}
|
|
}
|
|
|
|
/*
|
|
GenerateRepoForbidden describes a response with status code 403, with default header values.
|
|
|
|
APIForbiddenError is a forbidden error response
|
|
*/
|
|
type GenerateRepoForbidden struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this generate repo forbidden response has a 2xx status code
|
|
func (o *GenerateRepoForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this generate repo forbidden response has a 3xx status code
|
|
func (o *GenerateRepoForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this generate repo forbidden response has a 4xx status code
|
|
func (o *GenerateRepoForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this generate repo forbidden response has a 5xx status code
|
|
func (o *GenerateRepoForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this generate repo forbidden response a status code equal to that given
|
|
func (o *GenerateRepoForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the generate repo forbidden response
|
|
func (o *GenerateRepoForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *GenerateRepoForbidden) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoForbidden", 403)
|
|
}
|
|
|
|
func (o *GenerateRepoForbidden) String() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoForbidden", 403)
|
|
}
|
|
|
|
func (o *GenerateRepoForbidden) 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
|
|
}
|
|
|
|
// NewGenerateRepoNotFound creates a GenerateRepoNotFound with default headers values
|
|
func NewGenerateRepoNotFound() *GenerateRepoNotFound {
|
|
return &GenerateRepoNotFound{}
|
|
}
|
|
|
|
/*
|
|
GenerateRepoNotFound describes a response with status code 404, with default header values.
|
|
|
|
APINotFound is a not found empty response
|
|
*/
|
|
type GenerateRepoNotFound struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this generate repo not found response has a 2xx status code
|
|
func (o *GenerateRepoNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this generate repo not found response has a 3xx status code
|
|
func (o *GenerateRepoNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this generate repo not found response has a 4xx status code
|
|
func (o *GenerateRepoNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this generate repo not found response has a 5xx status code
|
|
func (o *GenerateRepoNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this generate repo not found response a status code equal to that given
|
|
func (o *GenerateRepoNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the generate repo not found response
|
|
func (o *GenerateRepoNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *GenerateRepoNotFound) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoNotFound", 404)
|
|
}
|
|
|
|
func (o *GenerateRepoNotFound) String() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoNotFound", 404)
|
|
}
|
|
|
|
func (o *GenerateRepoNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGenerateRepoConflict creates a GenerateRepoConflict with default headers values
|
|
func NewGenerateRepoConflict() *GenerateRepoConflict {
|
|
return &GenerateRepoConflict{}
|
|
}
|
|
|
|
/*
|
|
GenerateRepoConflict describes a response with status code 409, with default header values.
|
|
|
|
The repository with the same name already exists.
|
|
*/
|
|
type GenerateRepoConflict struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this generate repo conflict response has a 2xx status code
|
|
func (o *GenerateRepoConflict) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this generate repo conflict response has a 3xx status code
|
|
func (o *GenerateRepoConflict) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this generate repo conflict response has a 4xx status code
|
|
func (o *GenerateRepoConflict) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this generate repo conflict response has a 5xx status code
|
|
func (o *GenerateRepoConflict) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this generate repo conflict response a status code equal to that given
|
|
func (o *GenerateRepoConflict) IsCode(code int) bool {
|
|
return code == 409
|
|
}
|
|
|
|
// Code gets the status code for the generate repo conflict response
|
|
func (o *GenerateRepoConflict) Code() int {
|
|
return 409
|
|
}
|
|
|
|
func (o *GenerateRepoConflict) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoConflict", 409)
|
|
}
|
|
|
|
func (o *GenerateRepoConflict) String() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoConflict", 409)
|
|
}
|
|
|
|
func (o *GenerateRepoConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGenerateRepoUnprocessableEntity creates a GenerateRepoUnprocessableEntity with default headers values
|
|
func NewGenerateRepoUnprocessableEntity() *GenerateRepoUnprocessableEntity {
|
|
return &GenerateRepoUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
GenerateRepoUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
APIValidationError is error format response related to input validation
|
|
*/
|
|
type GenerateRepoUnprocessableEntity struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this generate repo unprocessable entity response has a 2xx status code
|
|
func (o *GenerateRepoUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this generate repo unprocessable entity response has a 3xx status code
|
|
func (o *GenerateRepoUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this generate repo unprocessable entity response has a 4xx status code
|
|
func (o *GenerateRepoUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this generate repo unprocessable entity response has a 5xx status code
|
|
func (o *GenerateRepoUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this generate repo unprocessable entity response a status code equal to that given
|
|
func (o *GenerateRepoUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the generate repo unprocessable entity response
|
|
func (o *GenerateRepoUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *GenerateRepoUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *GenerateRepoUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[POST /repos/{template_owner}/{template_repo}/generate][%d] generateRepoUnprocessableEntity", 422)
|
|
}
|
|
|
|
func (o *GenerateRepoUnprocessableEntity) 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
|
|
}
|