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

307 lines
9.3 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package issue
// 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"
)
// IssueDeleteTimeReader is a Reader for the IssueDeleteTime structure.
type IssueDeleteTimeReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *IssueDeleteTimeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewIssueDeleteTimeNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewIssueDeleteTimeBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewIssueDeleteTimeForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewIssueDeleteTimeNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}] issueDeleteTime", response, response.Code())
}
}
// NewIssueDeleteTimeNoContent creates a IssueDeleteTimeNoContent with default headers values
func NewIssueDeleteTimeNoContent() *IssueDeleteTimeNoContent {
return &IssueDeleteTimeNoContent{}
}
/*
IssueDeleteTimeNoContent describes a response with status code 204, with default header values.
APIEmpty is an empty response
*/
type IssueDeleteTimeNoContent struct {
}
// IsSuccess returns true when this issue delete time no content response has a 2xx status code
func (o *IssueDeleteTimeNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this issue delete time no content response has a 3xx status code
func (o *IssueDeleteTimeNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue delete time no content response has a 4xx status code
func (o *IssueDeleteTimeNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this issue delete time no content response has a 5xx status code
func (o *IssueDeleteTimeNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this issue delete time no content response a status code equal to that given
func (o *IssueDeleteTimeNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the issue delete time no content response
func (o *IssueDeleteTimeNoContent) Code() int {
return 204
}
func (o *IssueDeleteTimeNoContent) Error() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeNoContent", 204)
}
func (o *IssueDeleteTimeNoContent) String() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeNoContent", 204)
}
func (o *IssueDeleteTimeNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewIssueDeleteTimeBadRequest creates a IssueDeleteTimeBadRequest with default headers values
func NewIssueDeleteTimeBadRequest() *IssueDeleteTimeBadRequest {
return &IssueDeleteTimeBadRequest{}
}
/*
IssueDeleteTimeBadRequest describes a response with status code 400, with default header values.
APIError is error format response
*/
type IssueDeleteTimeBadRequest struct {
Message string
URL string
}
// IsSuccess returns true when this issue delete time bad request response has a 2xx status code
func (o *IssueDeleteTimeBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue delete time bad request response has a 3xx status code
func (o *IssueDeleteTimeBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue delete time bad request response has a 4xx status code
func (o *IssueDeleteTimeBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this issue delete time bad request response has a 5xx status code
func (o *IssueDeleteTimeBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this issue delete time bad request response a status code equal to that given
func (o *IssueDeleteTimeBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the issue delete time bad request response
func (o *IssueDeleteTimeBadRequest) Code() int {
return 400
}
func (o *IssueDeleteTimeBadRequest) Error() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeBadRequest", 400)
}
func (o *IssueDeleteTimeBadRequest) String() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeBadRequest", 400)
}
func (o *IssueDeleteTimeBadRequest) 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
}
// NewIssueDeleteTimeForbidden creates a IssueDeleteTimeForbidden with default headers values
func NewIssueDeleteTimeForbidden() *IssueDeleteTimeForbidden {
return &IssueDeleteTimeForbidden{}
}
/*
IssueDeleteTimeForbidden describes a response with status code 403, with default header values.
APIForbiddenError is a forbidden error response
*/
type IssueDeleteTimeForbidden struct {
Message string
URL string
}
// IsSuccess returns true when this issue delete time forbidden response has a 2xx status code
func (o *IssueDeleteTimeForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue delete time forbidden response has a 3xx status code
func (o *IssueDeleteTimeForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue delete time forbidden response has a 4xx status code
func (o *IssueDeleteTimeForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this issue delete time forbidden response has a 5xx status code
func (o *IssueDeleteTimeForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this issue delete time forbidden response a status code equal to that given
func (o *IssueDeleteTimeForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the issue delete time forbidden response
func (o *IssueDeleteTimeForbidden) Code() int {
return 403
}
func (o *IssueDeleteTimeForbidden) Error() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeForbidden", 403)
}
func (o *IssueDeleteTimeForbidden) String() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeForbidden", 403)
}
func (o *IssueDeleteTimeForbidden) 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
}
// NewIssueDeleteTimeNotFound creates a IssueDeleteTimeNotFound with default headers values
func NewIssueDeleteTimeNotFound() *IssueDeleteTimeNotFound {
return &IssueDeleteTimeNotFound{}
}
/*
IssueDeleteTimeNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type IssueDeleteTimeNotFound struct {
}
// IsSuccess returns true when this issue delete time not found response has a 2xx status code
func (o *IssueDeleteTimeNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue delete time not found response has a 3xx status code
func (o *IssueDeleteTimeNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue delete time not found response has a 4xx status code
func (o *IssueDeleteTimeNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this issue delete time not found response has a 5xx status code
func (o *IssueDeleteTimeNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this issue delete time not found response a status code equal to that given
func (o *IssueDeleteTimeNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the issue delete time not found response
func (o *IssueDeleteTimeNotFound) Code() int {
return 404
}
func (o *IssueDeleteTimeNotFound) Error() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeNotFound", 404)
}
func (o *IssueDeleteTimeNotFound) String() string {
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/times/{id}][%d] issueDeleteTimeNotFound", 404)
}
func (o *IssueDeleteTimeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}