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

151 lines
4.6 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package package_operations
// 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"
)
// DeletePackageReader is a Reader for the DeletePackage structure.
type DeletePackageReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeletePackageReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewDeletePackageNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 404:
result := NewDeletePackageNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /packages/{owner}/{type}/{name}/{version}] deletePackage", response, response.Code())
}
}
// NewDeletePackageNoContent creates a DeletePackageNoContent with default headers values
func NewDeletePackageNoContent() *DeletePackageNoContent {
return &DeletePackageNoContent{}
}
/*
DeletePackageNoContent describes a response with status code 204, with default header values.
APIEmpty is an empty response
*/
type DeletePackageNoContent struct {
}
// IsSuccess returns true when this delete package no content response has a 2xx status code
func (o *DeletePackageNoContent) IsSuccess() bool {
return true
}
// IsRedirect returns true when this delete package no content response has a 3xx status code
func (o *DeletePackageNoContent) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete package no content response has a 4xx status code
func (o *DeletePackageNoContent) IsClientError() bool {
return false
}
// IsServerError returns true when this delete package no content response has a 5xx status code
func (o *DeletePackageNoContent) IsServerError() bool {
return false
}
// IsCode returns true when this delete package no content response a status code equal to that given
func (o *DeletePackageNoContent) IsCode(code int) bool {
return code == 204
}
// Code gets the status code for the delete package no content response
func (o *DeletePackageNoContent) Code() int {
return 204
}
func (o *DeletePackageNoContent) Error() string {
return fmt.Sprintf("[DELETE /packages/{owner}/{type}/{name}/{version}][%d] deletePackageNoContent", 204)
}
func (o *DeletePackageNoContent) String() string {
return fmt.Sprintf("[DELETE /packages/{owner}/{type}/{name}/{version}][%d] deletePackageNoContent", 204)
}
func (o *DeletePackageNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewDeletePackageNotFound creates a DeletePackageNotFound with default headers values
func NewDeletePackageNotFound() *DeletePackageNotFound {
return &DeletePackageNotFound{}
}
/*
DeletePackageNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type DeletePackageNotFound struct {
}
// IsSuccess returns true when this delete package not found response has a 2xx status code
func (o *DeletePackageNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete package not found response has a 3xx status code
func (o *DeletePackageNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete package not found response has a 4xx status code
func (o *DeletePackageNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this delete package not found response has a 5xx status code
func (o *DeletePackageNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this delete package not found response a status code equal to that given
func (o *DeletePackageNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the delete package not found response
func (o *DeletePackageNotFound) Code() int {
return 404
}
func (o *DeletePackageNotFound) Error() string {
return fmt.Sprintf("[DELETE /packages/{owner}/{type}/{name}/{version}][%d] deletePackageNotFound", 404)
}
func (o *DeletePackageNotFound) String() string {
return fmt.Sprintf("[DELETE /packages/{owner}/{type}/{name}/{version}][%d] deletePackageNotFound", 404)
}
func (o *DeletePackageNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}