229 lines
7.1 KiB
Go
229 lines
7.1 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package user
|
|
|
|
// 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"
|
|
)
|
|
|
|
// UserCurrentPutStarReader is a Reader for the UserCurrentPutStar structure.
|
|
type UserCurrentPutStarReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *UserCurrentPutStarReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 204:
|
|
result := NewUserCurrentPutStarNoContent()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 403:
|
|
result := NewUserCurrentPutStarForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewUserCurrentPutStarNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[PUT /user/starred/{owner}/{repo}] userCurrentPutStar", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewUserCurrentPutStarNoContent creates a UserCurrentPutStarNoContent with default headers values
|
|
func NewUserCurrentPutStarNoContent() *UserCurrentPutStarNoContent {
|
|
return &UserCurrentPutStarNoContent{}
|
|
}
|
|
|
|
/*
|
|
UserCurrentPutStarNoContent describes a response with status code 204, with default header values.
|
|
|
|
APIEmpty is an empty response
|
|
*/
|
|
type UserCurrentPutStarNoContent struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this user current put star no content response has a 2xx status code
|
|
func (o *UserCurrentPutStarNoContent) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this user current put star no content response has a 3xx status code
|
|
func (o *UserCurrentPutStarNoContent) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this user current put star no content response has a 4xx status code
|
|
func (o *UserCurrentPutStarNoContent) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this user current put star no content response has a 5xx status code
|
|
func (o *UserCurrentPutStarNoContent) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this user current put star no content response a status code equal to that given
|
|
func (o *UserCurrentPutStarNoContent) IsCode(code int) bool {
|
|
return code == 204
|
|
}
|
|
|
|
// Code gets the status code for the user current put star no content response
|
|
func (o *UserCurrentPutStarNoContent) Code() int {
|
|
return 204
|
|
}
|
|
|
|
func (o *UserCurrentPutStarNoContent) Error() string {
|
|
return fmt.Sprintf("[PUT /user/starred/{owner}/{repo}][%d] userCurrentPutStarNoContent", 204)
|
|
}
|
|
|
|
func (o *UserCurrentPutStarNoContent) String() string {
|
|
return fmt.Sprintf("[PUT /user/starred/{owner}/{repo}][%d] userCurrentPutStarNoContent", 204)
|
|
}
|
|
|
|
func (o *UserCurrentPutStarNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewUserCurrentPutStarForbidden creates a UserCurrentPutStarForbidden with default headers values
|
|
func NewUserCurrentPutStarForbidden() *UserCurrentPutStarForbidden {
|
|
return &UserCurrentPutStarForbidden{}
|
|
}
|
|
|
|
/*
|
|
UserCurrentPutStarForbidden describes a response with status code 403, with default header values.
|
|
|
|
APIForbiddenError is a forbidden error response
|
|
*/
|
|
type UserCurrentPutStarForbidden struct {
|
|
Message string
|
|
URL string
|
|
}
|
|
|
|
// IsSuccess returns true when this user current put star forbidden response has a 2xx status code
|
|
func (o *UserCurrentPutStarForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this user current put star forbidden response has a 3xx status code
|
|
func (o *UserCurrentPutStarForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this user current put star forbidden response has a 4xx status code
|
|
func (o *UserCurrentPutStarForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this user current put star forbidden response has a 5xx status code
|
|
func (o *UserCurrentPutStarForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this user current put star forbidden response a status code equal to that given
|
|
func (o *UserCurrentPutStarForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the user current put star forbidden response
|
|
func (o *UserCurrentPutStarForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *UserCurrentPutStarForbidden) Error() string {
|
|
return fmt.Sprintf("[PUT /user/starred/{owner}/{repo}][%d] userCurrentPutStarForbidden", 403)
|
|
}
|
|
|
|
func (o *UserCurrentPutStarForbidden) String() string {
|
|
return fmt.Sprintf("[PUT /user/starred/{owner}/{repo}][%d] userCurrentPutStarForbidden", 403)
|
|
}
|
|
|
|
func (o *UserCurrentPutStarForbidden) 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
|
|
}
|
|
|
|
// NewUserCurrentPutStarNotFound creates a UserCurrentPutStarNotFound with default headers values
|
|
func NewUserCurrentPutStarNotFound() *UserCurrentPutStarNotFound {
|
|
return &UserCurrentPutStarNotFound{}
|
|
}
|
|
|
|
/*
|
|
UserCurrentPutStarNotFound describes a response with status code 404, with default header values.
|
|
|
|
APINotFound is a not found empty response
|
|
*/
|
|
type UserCurrentPutStarNotFound struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this user current put star not found response has a 2xx status code
|
|
func (o *UserCurrentPutStarNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this user current put star not found response has a 3xx status code
|
|
func (o *UserCurrentPutStarNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this user current put star not found response has a 4xx status code
|
|
func (o *UserCurrentPutStarNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this user current put star not found response has a 5xx status code
|
|
func (o *UserCurrentPutStarNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this user current put star not found response a status code equal to that given
|
|
func (o *UserCurrentPutStarNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the user current put star not found response
|
|
func (o *UserCurrentPutStarNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *UserCurrentPutStarNotFound) Error() string {
|
|
return fmt.Sprintf("[PUT /user/starred/{owner}/{repo}][%d] userCurrentPutStarNotFound", 404)
|
|
}
|
|
|
|
func (o *UserCurrentPutStarNotFound) String() string {
|
|
return fmt.Sprintf("[PUT /user/starred/{owner}/{repo}][%d] userCurrentPutStarNotFound", 404)
|
|
}
|
|
|
|
func (o *UserCurrentPutStarNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|