gtslib/client/admin/admin_reports_responses.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

427 lines
13 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package admin
// 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"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AdminReportsReader is a Reader for the AdminReports structure.
type AdminReportsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AdminReportsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAdminReportsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAdminReportsBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAdminReportsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAdminReportsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAdminReportsNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAdminReportsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/admin/reports] adminReports", response, response.Code())
}
}
// NewAdminReportsOK creates a AdminReportsOK with default headers values
func NewAdminReportsOK() *AdminReportsOK {
return &AdminReportsOK{}
}
/*
AdminReportsOK describes a response with status code 200, with default header values.
Array of reports.
*/
type AdminReportsOK struct {
/* Links to the next and previous queries.
*/
Link string
Payload []*models.AdminReport
}
// IsSuccess returns true when this admin reports o k response has a 2xx status code
func (o *AdminReportsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this admin reports o k response has a 3xx status code
func (o *AdminReportsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin reports o k response has a 4xx status code
func (o *AdminReportsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this admin reports o k response has a 5xx status code
func (o *AdminReportsOK) IsServerError() bool {
return false
}
// IsCode returns true when this admin reports o k response a status code equal to that given
func (o *AdminReportsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the admin reports o k response
func (o *AdminReportsOK) Code() int {
return 200
}
func (o *AdminReportsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsOK %s", 200, payload)
}
func (o *AdminReportsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsOK %s", 200, payload)
}
func (o *AdminReportsOK) GetPayload() []*models.AdminReport {
return o.Payload
}
func (o *AdminReportsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Link
hdrLink := response.GetHeader("Link")
if hdrLink != "" {
o.Link = hdrLink
}
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAdminReportsBadRequest creates a AdminReportsBadRequest with default headers values
func NewAdminReportsBadRequest() *AdminReportsBadRequest {
return &AdminReportsBadRequest{}
}
/*
AdminReportsBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AdminReportsBadRequest struct {
}
// IsSuccess returns true when this admin reports bad request response has a 2xx status code
func (o *AdminReportsBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin reports bad request response has a 3xx status code
func (o *AdminReportsBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin reports bad request response has a 4xx status code
func (o *AdminReportsBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this admin reports bad request response has a 5xx status code
func (o *AdminReportsBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this admin reports bad request response a status code equal to that given
func (o *AdminReportsBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the admin reports bad request response
func (o *AdminReportsBadRequest) Code() int {
return 400
}
func (o *AdminReportsBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsBadRequest", 400)
}
func (o *AdminReportsBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsBadRequest", 400)
}
func (o *AdminReportsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminReportsUnauthorized creates a AdminReportsUnauthorized with default headers values
func NewAdminReportsUnauthorized() *AdminReportsUnauthorized {
return &AdminReportsUnauthorized{}
}
/*
AdminReportsUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AdminReportsUnauthorized struct {
}
// IsSuccess returns true when this admin reports unauthorized response has a 2xx status code
func (o *AdminReportsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin reports unauthorized response has a 3xx status code
func (o *AdminReportsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin reports unauthorized response has a 4xx status code
func (o *AdminReportsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this admin reports unauthorized response has a 5xx status code
func (o *AdminReportsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this admin reports unauthorized response a status code equal to that given
func (o *AdminReportsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the admin reports unauthorized response
func (o *AdminReportsUnauthorized) Code() int {
return 401
}
func (o *AdminReportsUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsUnauthorized", 401)
}
func (o *AdminReportsUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsUnauthorized", 401)
}
func (o *AdminReportsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminReportsNotFound creates a AdminReportsNotFound with default headers values
func NewAdminReportsNotFound() *AdminReportsNotFound {
return &AdminReportsNotFound{}
}
/*
AdminReportsNotFound describes a response with status code 404, with default header values.
not found
*/
type AdminReportsNotFound struct {
}
// IsSuccess returns true when this admin reports not found response has a 2xx status code
func (o *AdminReportsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin reports not found response has a 3xx status code
func (o *AdminReportsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin reports not found response has a 4xx status code
func (o *AdminReportsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this admin reports not found response has a 5xx status code
func (o *AdminReportsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this admin reports not found response a status code equal to that given
func (o *AdminReportsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the admin reports not found response
func (o *AdminReportsNotFound) Code() int {
return 404
}
func (o *AdminReportsNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsNotFound", 404)
}
func (o *AdminReportsNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsNotFound", 404)
}
func (o *AdminReportsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminReportsNotAcceptable creates a AdminReportsNotAcceptable with default headers values
func NewAdminReportsNotAcceptable() *AdminReportsNotAcceptable {
return &AdminReportsNotAcceptable{}
}
/*
AdminReportsNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AdminReportsNotAcceptable struct {
}
// IsSuccess returns true when this admin reports not acceptable response has a 2xx status code
func (o *AdminReportsNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin reports not acceptable response has a 3xx status code
func (o *AdminReportsNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin reports not acceptable response has a 4xx status code
func (o *AdminReportsNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this admin reports not acceptable response has a 5xx status code
func (o *AdminReportsNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this admin reports not acceptable response a status code equal to that given
func (o *AdminReportsNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the admin reports not acceptable response
func (o *AdminReportsNotAcceptable) Code() int {
return 406
}
func (o *AdminReportsNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsNotAcceptable", 406)
}
func (o *AdminReportsNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsNotAcceptable", 406)
}
func (o *AdminReportsNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAdminReportsInternalServerError creates a AdminReportsInternalServerError with default headers values
func NewAdminReportsInternalServerError() *AdminReportsInternalServerError {
return &AdminReportsInternalServerError{}
}
/*
AdminReportsInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AdminReportsInternalServerError struct {
}
// IsSuccess returns true when this admin reports internal server error response has a 2xx status code
func (o *AdminReportsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this admin reports internal server error response has a 3xx status code
func (o *AdminReportsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this admin reports internal server error response has a 4xx status code
func (o *AdminReportsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this admin reports internal server error response has a 5xx status code
func (o *AdminReportsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this admin reports internal server error response a status code equal to that given
func (o *AdminReportsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the admin reports internal server error response
func (o *AdminReportsInternalServerError) Code() int {
return 500
}
func (o *AdminReportsInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsInternalServerError", 500)
}
func (o *AdminReportsInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/admin/reports][%d] adminReportsInternalServerError", 500)
}
func (o *AdminReportsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}