// 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" ) // IssueDeleteReader is a Reader for the IssueDelete structure. type IssueDeleteReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *IssueDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 204: result := NewIssueDeleteNoContent() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: result := NewIssueDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewIssueDeleteNotFound() 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}] issueDelete", response, response.Code()) } } // NewIssueDeleteNoContent creates a IssueDeleteNoContent with default headers values func NewIssueDeleteNoContent() *IssueDeleteNoContent { return &IssueDeleteNoContent{} } /* IssueDeleteNoContent describes a response with status code 204, with default header values. APIEmpty is an empty response */ type IssueDeleteNoContent struct { } // IsSuccess returns true when this issue delete no content response has a 2xx status code func (o *IssueDeleteNoContent) IsSuccess() bool { return true } // IsRedirect returns true when this issue delete no content response has a 3xx status code func (o *IssueDeleteNoContent) IsRedirect() bool { return false } // IsClientError returns true when this issue delete no content response has a 4xx status code func (o *IssueDeleteNoContent) IsClientError() bool { return false } // IsServerError returns true when this issue delete no content response has a 5xx status code func (o *IssueDeleteNoContent) IsServerError() bool { return false } // IsCode returns true when this issue delete no content response a status code equal to that given func (o *IssueDeleteNoContent) IsCode(code int) bool { return code == 204 } // Code gets the status code for the issue delete no content response func (o *IssueDeleteNoContent) Code() int { return 204 } func (o *IssueDeleteNoContent) Error() string { return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}][%d] issueDeleteNoContent", 204) } func (o *IssueDeleteNoContent) String() string { return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}][%d] issueDeleteNoContent", 204) } func (o *IssueDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewIssueDeleteForbidden creates a IssueDeleteForbidden with default headers values func NewIssueDeleteForbidden() *IssueDeleteForbidden { return &IssueDeleteForbidden{} } /* IssueDeleteForbidden describes a response with status code 403, with default header values. APIForbiddenError is a forbidden error response */ type IssueDeleteForbidden struct { Message string URL string } // IsSuccess returns true when this issue delete forbidden response has a 2xx status code func (o *IssueDeleteForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this issue delete forbidden response has a 3xx status code func (o *IssueDeleteForbidden) IsRedirect() bool { return false } // IsClientError returns true when this issue delete forbidden response has a 4xx status code func (o *IssueDeleteForbidden) IsClientError() bool { return true } // IsServerError returns true when this issue delete forbidden response has a 5xx status code func (o *IssueDeleteForbidden) IsServerError() bool { return false } // IsCode returns true when this issue delete forbidden response a status code equal to that given func (o *IssueDeleteForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the issue delete forbidden response func (o *IssueDeleteForbidden) Code() int { return 403 } func (o *IssueDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}][%d] issueDeleteForbidden", 403) } func (o *IssueDeleteForbidden) String() string { return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}][%d] issueDeleteForbidden", 403) } func (o *IssueDeleteForbidden) 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 } // NewIssueDeleteNotFound creates a IssueDeleteNotFound with default headers values func NewIssueDeleteNotFound() *IssueDeleteNotFound { return &IssueDeleteNotFound{} } /* IssueDeleteNotFound describes a response with status code 404, with default header values. APINotFound is a not found empty response */ type IssueDeleteNotFound struct { } // IsSuccess returns true when this issue delete not found response has a 2xx status code func (o *IssueDeleteNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this issue delete not found response has a 3xx status code func (o *IssueDeleteNotFound) IsRedirect() bool { return false } // IsClientError returns true when this issue delete not found response has a 4xx status code func (o *IssueDeleteNotFound) IsClientError() bool { return true } // IsServerError returns true when this issue delete not found response has a 5xx status code func (o *IssueDeleteNotFound) IsServerError() bool { return false } // IsCode returns true when this issue delete not found response a status code equal to that given func (o *IssueDeleteNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the issue delete not found response func (o *IssueDeleteNotFound) Code() int { return 404 } func (o *IssueDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}][%d] issueDeleteNotFound", 404) } func (o *IssueDeleteNotFound) String() string { return fmt.Sprintf("[DELETE /repos/{owner}/{repo}/issues/{index}][%d] issueDeleteNotFound", 404) } func (o *IssueDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil }