autogits/bots-common/gitea-generated/client/repository/repo_add_team_responses.go
Adam Majer 598ecbbd5a .
2024-07-07 21:12:40 +02:00

307 lines
9.2 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"
)
// RepoAddTeamReader is a Reader for the RepoAddTeam structure.
type RepoAddTeamReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *RepoAddTeamReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewRepoAddTeamNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewRepoAddTeamNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 405:
result := NewRepoAddTeamMethodNotAllowed()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewRepoAddTeamUnprocessableEntity()
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}/teams/{team}] repoAddTeam", response, response.Code())
}
}
// NewRepoAddTeamNoContent creates a RepoAddTeamNoContent with default headers values
func NewRepoAddTeamNoContent() *RepoAddTeamNoContent {
return &RepoAddTeamNoContent{}
}
/*
RepoAddTeamNoContent describes a response with status code 204, with default header values.
APIEmpty is an empty response
*/
type RepoAddTeamNoContent struct {
}
// IsSuccess returns true when this repo add team no content response has a 2xx status code
func (o *RepoAddTeamNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this repo add team no content response has a 3xx status code
func (o *RepoAddTeamNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo add team no content response has a 4xx status code
func (o *RepoAddTeamNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this repo add team no content response has a 5xx status code
func (o *RepoAddTeamNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this repo add team no content response a status code equal to that given
func (o *RepoAddTeamNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the repo add team no content response
func (o *RepoAddTeamNoContent) Code() int {
return 204
}
func (o *RepoAddTeamNoContent) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamNoContent", 204)
}
func (o *RepoAddTeamNoContent) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamNoContent", 204)
}
func (o *RepoAddTeamNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewRepoAddTeamNotFound creates a RepoAddTeamNotFound with default headers values
func NewRepoAddTeamNotFound() *RepoAddTeamNotFound {
return &RepoAddTeamNotFound{}
}
/*
RepoAddTeamNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type RepoAddTeamNotFound struct {
}
// IsSuccess returns true when this repo add team not found response has a 2xx status code
func (o *RepoAddTeamNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo add team not found response has a 3xx status code
func (o *RepoAddTeamNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo add team not found response has a 4xx status code
func (o *RepoAddTeamNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this repo add team not found response has a 5xx status code
func (o *RepoAddTeamNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this repo add team not found response a status code equal to that given
func (o *RepoAddTeamNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the repo add team not found response
func (o *RepoAddTeamNotFound) Code() int {
return 404
}
func (o *RepoAddTeamNotFound) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamNotFound", 404)
}
func (o *RepoAddTeamNotFound) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamNotFound", 404)
}
func (o *RepoAddTeamNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewRepoAddTeamMethodNotAllowed creates a RepoAddTeamMethodNotAllowed with default headers values
func NewRepoAddTeamMethodNotAllowed() *RepoAddTeamMethodNotAllowed {
return &RepoAddTeamMethodNotAllowed{}
}
/*
RepoAddTeamMethodNotAllowed describes a response with status code 405, with default header values.
APIError is error format response
*/
type RepoAddTeamMethodNotAllowed struct {
Message string
URL string
}
// IsSuccess returns true when this repo add team method not allowed response has a 2xx status code
func (o *RepoAddTeamMethodNotAllowed) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo add team method not allowed response has a 3xx status code
func (o *RepoAddTeamMethodNotAllowed) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo add team method not allowed response has a 4xx status code
func (o *RepoAddTeamMethodNotAllowed) IsClientError() bool {
return true
}
// IsServerError returns true when this repo add team method not allowed response has a 5xx status code
func (o *RepoAddTeamMethodNotAllowed) IsServerError() bool {
return false
}
// IsCode returns true when this repo add team method not allowed response a status code equal to that given
func (o *RepoAddTeamMethodNotAllowed) IsCode(code int) bool {
return code == 405
}
// Code gets the status code for the repo add team method not allowed response
func (o *RepoAddTeamMethodNotAllowed) Code() int {
return 405
}
func (o *RepoAddTeamMethodNotAllowed) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamMethodNotAllowed", 405)
}
func (o *RepoAddTeamMethodNotAllowed) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamMethodNotAllowed", 405)
}
func (o *RepoAddTeamMethodNotAllowed) 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
}
// NewRepoAddTeamUnprocessableEntity creates a RepoAddTeamUnprocessableEntity with default headers values
func NewRepoAddTeamUnprocessableEntity() *RepoAddTeamUnprocessableEntity {
return &RepoAddTeamUnprocessableEntity{}
}
/*
RepoAddTeamUnprocessableEntity describes a response with status code 422, with default header values.
APIValidationError is error format response related to input validation
*/
type RepoAddTeamUnprocessableEntity struct {
Message string
URL string
}
// IsSuccess returns true when this repo add team unprocessable entity response has a 2xx status code
func (o *RepoAddTeamUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this repo add team unprocessable entity response has a 3xx status code
func (o *RepoAddTeamUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this repo add team unprocessable entity response has a 4xx status code
func (o *RepoAddTeamUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this repo add team unprocessable entity response has a 5xx status code
func (o *RepoAddTeamUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this repo add team unprocessable entity response a status code equal to that given
func (o *RepoAddTeamUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the repo add team unprocessable entity response
func (o *RepoAddTeamUnprocessableEntity) Code() int {
return 422
}
func (o *RepoAddTeamUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamUnprocessableEntity", 422)
}
func (o *RepoAddTeamUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/teams/{team}][%d] repoAddTeamUnprocessableEntity", 422)
}
func (o *RepoAddTeamUnprocessableEntity) 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
}