245 lines
8.2 KiB
Go
245 lines
8.2 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"
|
||
|
)
|
||
|
|
||
|
// IssueDeleteIssueAttachmentReader is a Reader for the IssueDeleteIssueAttachment structure.
|
||
|
type IssueDeleteIssueAttachmentReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *IssueDeleteIssueAttachmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 204:
|
||
|
result := NewIssueDeleteIssueAttachmentNoContent()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 404:
|
||
|
result := NewIssueDeleteIssueAttachmentNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 423:
|
||
|
result := NewIssueDeleteIssueAttachmentLocked()
|
||
|
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}/assets/{attachment_id}] issueDeleteIssueAttachment", response, response.Code())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewIssueDeleteIssueAttachmentNoContent creates a IssueDeleteIssueAttachmentNoContent with default headers values
|
||
|
func NewIssueDeleteIssueAttachmentNoContent() *IssueDeleteIssueAttachmentNoContent {
|
||
|
return &IssueDeleteIssueAttachmentNoContent{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
IssueDeleteIssueAttachmentNoContent describes a response with status code 204, with default header values.
|
||
|
|
||
|
APIEmpty is an empty response
|
||
|
*/
|
||
|
type IssueDeleteIssueAttachmentNoContent struct {
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this issue delete issue attachment no content response has a 2xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this issue delete issue attachment no content response has a 3xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this issue delete issue attachment no content response has a 4xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this issue delete issue attachment no content response has a 5xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this issue delete issue attachment no content response a status code equal to that given
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) IsCode(code int) bool {
|
||
|
return code == 204
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the issue delete issue attachment no content response
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) Code() int {
|
||
|
return 204
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) Error() string {
|
||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueDeleteIssueAttachmentNoContent", 204)
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) String() string {
|
||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueDeleteIssueAttachmentNoContent", 204)
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewIssueDeleteIssueAttachmentNotFound creates a IssueDeleteIssueAttachmentNotFound with default headers values
|
||
|
func NewIssueDeleteIssueAttachmentNotFound() *IssueDeleteIssueAttachmentNotFound {
|
||
|
return &IssueDeleteIssueAttachmentNotFound{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
IssueDeleteIssueAttachmentNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
APIError is error format response
|
||
|
*/
|
||
|
type IssueDeleteIssueAttachmentNotFound struct {
|
||
|
Message string
|
||
|
URL string
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this issue delete issue attachment not found response has a 2xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this issue delete issue attachment not found response has a 3xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this issue delete issue attachment not found response has a 4xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this issue delete issue attachment not found response has a 5xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this issue delete issue attachment not found response a status code equal to that given
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) IsCode(code int) bool {
|
||
|
return code == 404
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the issue delete issue attachment not found response
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) Code() int {
|
||
|
return 404
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) Error() string {
|
||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueDeleteIssueAttachmentNotFound", 404)
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) String() string {
|
||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueDeleteIssueAttachmentNotFound", 404)
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewIssueDeleteIssueAttachmentLocked creates a IssueDeleteIssueAttachmentLocked with default headers values
|
||
|
func NewIssueDeleteIssueAttachmentLocked() *IssueDeleteIssueAttachmentLocked {
|
||
|
return &IssueDeleteIssueAttachmentLocked{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
IssueDeleteIssueAttachmentLocked describes a response with status code 423, with default header values.
|
||
|
|
||
|
APIRepoArchivedError is an error that is raised when an archived repo should be modified
|
||
|
*/
|
||
|
type IssueDeleteIssueAttachmentLocked struct {
|
||
|
Message string
|
||
|
URL string
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this issue delete issue attachment locked response has a 2xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this issue delete issue attachment locked response has a 3xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this issue delete issue attachment locked response has a 4xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this issue delete issue attachment locked response has a 5xx status code
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this issue delete issue attachment locked response a status code equal to that given
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) IsCode(code int) bool {
|
||
|
return code == 423
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the issue delete issue attachment locked response
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) Code() int {
|
||
|
return 423
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) Error() string {
|
||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueDeleteIssueAttachmentLocked", 423)
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) String() string {
|
||
|
return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}][%d] issueDeleteIssueAttachmentLocked", 423)
|
||
|
}
|
||
|
|
||
|
func (o *IssueDeleteIssueAttachmentLocked) 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
|
||
|
}
|