autogits/bots-common/gitea-generated/client/issue/issue_post_comment_reaction_responses.go

323 lines
11 KiB
Go
Raw Normal View History

2024-07-07 21:08:41 +02:00
// 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 (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"src.opensuse.org/autogits/common/gitea-generated/models"
)
// IssuePostCommentReactionReader is a Reader for the IssuePostCommentReaction structure.
type IssuePostCommentReactionReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *IssuePostCommentReactionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewIssuePostCommentReactionOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 201:
result := NewIssuePostCommentReactionCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 403:
result := NewIssuePostCommentReactionForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewIssuePostCommentReactionNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions] issuePostCommentReaction", response, response.Code())
}
}
// NewIssuePostCommentReactionOK creates a IssuePostCommentReactionOK with default headers values
func NewIssuePostCommentReactionOK() *IssuePostCommentReactionOK {
return &IssuePostCommentReactionOK{}
}
/*
IssuePostCommentReactionOK describes a response with status code 200, with default header values.
Reaction
*/
type IssuePostCommentReactionOK struct {
Payload *models.Reaction
}
// IsSuccess returns true when this issue post comment reaction o k response has a 2xx status code
func (o *IssuePostCommentReactionOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this issue post comment reaction o k response has a 3xx status code
func (o *IssuePostCommentReactionOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue post comment reaction o k response has a 4xx status code
func (o *IssuePostCommentReactionOK) IsClientError() bool {
return false
}
// IsServerError returns true when this issue post comment reaction o k response has a 5xx status code
func (o *IssuePostCommentReactionOK) IsServerError() bool {
return false
}
// IsCode returns true when this issue post comment reaction o k response a status code equal to that given
func (o *IssuePostCommentReactionOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the issue post comment reaction o k response
func (o *IssuePostCommentReactionOK) Code() int {
return 200
}
func (o *IssuePostCommentReactionOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionOK %s", 200, payload)
}
func (o *IssuePostCommentReactionOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionOK %s", 200, payload)
}
func (o *IssuePostCommentReactionOK) GetPayload() *models.Reaction {
return o.Payload
}
func (o *IssuePostCommentReactionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Reaction)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewIssuePostCommentReactionCreated creates a IssuePostCommentReactionCreated with default headers values
func NewIssuePostCommentReactionCreated() *IssuePostCommentReactionCreated {
return &IssuePostCommentReactionCreated{}
}
/*
IssuePostCommentReactionCreated describes a response with status code 201, with default header values.
Reaction
*/
type IssuePostCommentReactionCreated struct {
Payload *models.Reaction
}
// IsSuccess returns true when this issue post comment reaction created response has a 2xx status code
func (o *IssuePostCommentReactionCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this issue post comment reaction created response has a 3xx status code
func (o *IssuePostCommentReactionCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue post comment reaction created response has a 4xx status code
func (o *IssuePostCommentReactionCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this issue post comment reaction created response has a 5xx status code
func (o *IssuePostCommentReactionCreated) IsServerError() bool {
return false
}
// IsCode returns true when this issue post comment reaction created response a status code equal to that given
func (o *IssuePostCommentReactionCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the issue post comment reaction created response
func (o *IssuePostCommentReactionCreated) Code() int {
return 201
}
func (o *IssuePostCommentReactionCreated) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionCreated %s", 201, payload)
}
func (o *IssuePostCommentReactionCreated) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionCreated %s", 201, payload)
}
func (o *IssuePostCommentReactionCreated) GetPayload() *models.Reaction {
return o.Payload
}
func (o *IssuePostCommentReactionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Reaction)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewIssuePostCommentReactionForbidden creates a IssuePostCommentReactionForbidden with default headers values
func NewIssuePostCommentReactionForbidden() *IssuePostCommentReactionForbidden {
return &IssuePostCommentReactionForbidden{}
}
/*
IssuePostCommentReactionForbidden describes a response with status code 403, with default header values.
APIForbiddenError is a forbidden error response
*/
type IssuePostCommentReactionForbidden struct {
Message string
URL string
}
// IsSuccess returns true when this issue post comment reaction forbidden response has a 2xx status code
func (o *IssuePostCommentReactionForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue post comment reaction forbidden response has a 3xx status code
func (o *IssuePostCommentReactionForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue post comment reaction forbidden response has a 4xx status code
func (o *IssuePostCommentReactionForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this issue post comment reaction forbidden response has a 5xx status code
func (o *IssuePostCommentReactionForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this issue post comment reaction forbidden response a status code equal to that given
func (o *IssuePostCommentReactionForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the issue post comment reaction forbidden response
func (o *IssuePostCommentReactionForbidden) Code() int {
return 403
}
func (o *IssuePostCommentReactionForbidden) Error() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionForbidden", 403)
}
func (o *IssuePostCommentReactionForbidden) String() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionForbidden", 403)
}
func (o *IssuePostCommentReactionForbidden) 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
}
// NewIssuePostCommentReactionNotFound creates a IssuePostCommentReactionNotFound with default headers values
func NewIssuePostCommentReactionNotFound() *IssuePostCommentReactionNotFound {
return &IssuePostCommentReactionNotFound{}
}
/*
IssuePostCommentReactionNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type IssuePostCommentReactionNotFound struct {
}
// IsSuccess returns true when this issue post comment reaction not found response has a 2xx status code
func (o *IssuePostCommentReactionNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue post comment reaction not found response has a 3xx status code
func (o *IssuePostCommentReactionNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue post comment reaction not found response has a 4xx status code
func (o *IssuePostCommentReactionNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this issue post comment reaction not found response has a 5xx status code
func (o *IssuePostCommentReactionNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this issue post comment reaction not found response a status code equal to that given
func (o *IssuePostCommentReactionNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the issue post comment reaction not found response
func (o *IssuePostCommentReactionNotFound) Code() int {
return 404
}
func (o *IssuePostCommentReactionNotFound) Error() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionNotFound", 404)
}
func (o *IssuePostCommentReactionNotFound) String() string {
return fmt.Sprintf("[POST /repos/{owner}/{repo}/issues/comments/{id}/reactions][%d] issuePostCommentReactionNotFound", 404)
}
func (o *IssuePostCommentReactionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}