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

275 lines
9.2 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 (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// IssueAddSubscriptionReader is a Reader for the IssueAddSubscription structure.
type IssueAddSubscriptionReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *IssueAddSubscriptionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewIssueAddSubscriptionOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 201:
result := NewIssueAddSubscriptionCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 304:
result := NewIssueAddSubscriptionNotModified()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewIssueAddSubscriptionNotFound()
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}/issues/{index}/subscriptions/{user}] issueAddSubscription", response, response.Code())
}
}
// NewIssueAddSubscriptionOK creates a IssueAddSubscriptionOK with default headers values
func NewIssueAddSubscriptionOK() *IssueAddSubscriptionOK {
return &IssueAddSubscriptionOK{}
}
/*
IssueAddSubscriptionOK describes a response with status code 200, with default header values.
Already subscribed
*/
type IssueAddSubscriptionOK struct {
}
// IsSuccess returns true when this issue add subscription o k response has a 2xx status code
func (o *IssueAddSubscriptionOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this issue add subscription o k response has a 3xx status code
func (o *IssueAddSubscriptionOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue add subscription o k response has a 4xx status code
func (o *IssueAddSubscriptionOK) IsClientError() bool {
return false
}
// IsServerError returns true when this issue add subscription o k response has a 5xx status code
func (o *IssueAddSubscriptionOK) IsServerError() bool {
return false
}
// IsCode returns true when this issue add subscription o k response a status code equal to that given
func (o *IssueAddSubscriptionOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the issue add subscription o k response
func (o *IssueAddSubscriptionOK) Code() int {
return 200
}
func (o *IssueAddSubscriptionOK) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionOK", 200)
}
func (o *IssueAddSubscriptionOK) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionOK", 200)
}
func (o *IssueAddSubscriptionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewIssueAddSubscriptionCreated creates a IssueAddSubscriptionCreated with default headers values
func NewIssueAddSubscriptionCreated() *IssueAddSubscriptionCreated {
return &IssueAddSubscriptionCreated{}
}
/*
IssueAddSubscriptionCreated describes a response with status code 201, with default header values.
Successfully Subscribed
*/
type IssueAddSubscriptionCreated struct {
}
// IsSuccess returns true when this issue add subscription created response has a 2xx status code
func (o *IssueAddSubscriptionCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this issue add subscription created response has a 3xx status code
func (o *IssueAddSubscriptionCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue add subscription created response has a 4xx status code
func (o *IssueAddSubscriptionCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this issue add subscription created response has a 5xx status code
func (o *IssueAddSubscriptionCreated) IsServerError() bool {
return false
}
// IsCode returns true when this issue add subscription created response a status code equal to that given
func (o *IssueAddSubscriptionCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the issue add subscription created response
func (o *IssueAddSubscriptionCreated) Code() int {
return 201
}
func (o *IssueAddSubscriptionCreated) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionCreated", 201)
}
func (o *IssueAddSubscriptionCreated) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionCreated", 201)
}
func (o *IssueAddSubscriptionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewIssueAddSubscriptionNotModified creates a IssueAddSubscriptionNotModified with default headers values
func NewIssueAddSubscriptionNotModified() *IssueAddSubscriptionNotModified {
return &IssueAddSubscriptionNotModified{}
}
/*
IssueAddSubscriptionNotModified describes a response with status code 304, with default header values.
User can only subscribe itself if he is no admin
*/
type IssueAddSubscriptionNotModified struct {
}
// IsSuccess returns true when this issue add subscription not modified response has a 2xx status code
func (o *IssueAddSubscriptionNotModified) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue add subscription not modified response has a 3xx status code
func (o *IssueAddSubscriptionNotModified) IsRedirect() bool {
return true
}
// IsClientError returns true when this issue add subscription not modified response has a 4xx status code
func (o *IssueAddSubscriptionNotModified) IsClientError() bool {
return false
}
// IsServerError returns true when this issue add subscription not modified response has a 5xx status code
func (o *IssueAddSubscriptionNotModified) IsServerError() bool {
return false
}
// IsCode returns true when this issue add subscription not modified response a status code equal to that given
func (o *IssueAddSubscriptionNotModified) IsCode(code int) bool {
return code == 304
}
// Code gets the status code for the issue add subscription not modified response
func (o *IssueAddSubscriptionNotModified) Code() int {
return 304
}
func (o *IssueAddSubscriptionNotModified) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionNotModified", 304)
}
func (o *IssueAddSubscriptionNotModified) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionNotModified", 304)
}
func (o *IssueAddSubscriptionNotModified) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewIssueAddSubscriptionNotFound creates a IssueAddSubscriptionNotFound with default headers values
func NewIssueAddSubscriptionNotFound() *IssueAddSubscriptionNotFound {
return &IssueAddSubscriptionNotFound{}
}
/*
IssueAddSubscriptionNotFound describes a response with status code 404, with default header values.
APINotFound is a not found empty response
*/
type IssueAddSubscriptionNotFound struct {
}
// IsSuccess returns true when this issue add subscription not found response has a 2xx status code
func (o *IssueAddSubscriptionNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this issue add subscription not found response has a 3xx status code
func (o *IssueAddSubscriptionNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this issue add subscription not found response has a 4xx status code
func (o *IssueAddSubscriptionNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this issue add subscription not found response has a 5xx status code
func (o *IssueAddSubscriptionNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this issue add subscription not found response a status code equal to that given
func (o *IssueAddSubscriptionNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the issue add subscription not found response
func (o *IssueAddSubscriptionNotFound) Code() int {
return 404
}
func (o *IssueAddSubscriptionNotFound) Error() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionNotFound", 404)
}
func (o *IssueAddSubscriptionNotFound) String() string {
return fmt.Sprintf("[PUT /repos/{owner}/{repo}/issues/{index}/subscriptions/{user}][%d] issueAddSubscriptionNotFound", 404)
}
func (o *IssueAddSubscriptionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}