// Code generated by go-swagger; DO NOT EDIT. package admin // 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" ) // AdminEditUserReader is a Reader for the AdminEditUser structure. type AdminEditUserReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *AdminEditUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewAdminEditUserOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewAdminEditUserBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewAdminEditUserForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewAdminEditUserUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[PATCH /admin/users/{username}] adminEditUser", response, response.Code()) } } // NewAdminEditUserOK creates a AdminEditUserOK with default headers values func NewAdminEditUserOK() *AdminEditUserOK { return &AdminEditUserOK{} } /* AdminEditUserOK describes a response with status code 200, with default header values. User */ type AdminEditUserOK struct { Payload *models.User } // IsSuccess returns true when this admin edit user o k response has a 2xx status code func (o *AdminEditUserOK) IsSuccess() bool { return true } // IsRedirect returns true when this admin edit user o k response has a 3xx status code func (o *AdminEditUserOK) IsRedirect() bool { return false } // IsClientError returns true when this admin edit user o k response has a 4xx status code func (o *AdminEditUserOK) IsClientError() bool { return false } // IsServerError returns true when this admin edit user o k response has a 5xx status code func (o *AdminEditUserOK) IsServerError() bool { return false } // IsCode returns true when this admin edit user o k response a status code equal to that given func (o *AdminEditUserOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the admin edit user o k response func (o *AdminEditUserOK) Code() int { return 200 } func (o *AdminEditUserOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserOK %s", 200, payload) } func (o *AdminEditUserOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserOK %s", 200, payload) } func (o *AdminEditUserOK) GetPayload() *models.User { return o.Payload } func (o *AdminEditUserOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.User) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewAdminEditUserBadRequest creates a AdminEditUserBadRequest with default headers values func NewAdminEditUserBadRequest() *AdminEditUserBadRequest { return &AdminEditUserBadRequest{} } /* AdminEditUserBadRequest describes a response with status code 400, with default header values. APIError is error format response */ type AdminEditUserBadRequest struct { Message string URL string } // IsSuccess returns true when this admin edit user bad request response has a 2xx status code func (o *AdminEditUserBadRequest) IsSuccess() bool { return false } // IsRedirect returns true when this admin edit user bad request response has a 3xx status code func (o *AdminEditUserBadRequest) IsRedirect() bool { return false } // IsClientError returns true when this admin edit user bad request response has a 4xx status code func (o *AdminEditUserBadRequest) IsClientError() bool { return true } // IsServerError returns true when this admin edit user bad request response has a 5xx status code func (o *AdminEditUserBadRequest) IsServerError() bool { return false } // IsCode returns true when this admin edit user bad request response a status code equal to that given func (o *AdminEditUserBadRequest) IsCode(code int) bool { return code == 400 } // Code gets the status code for the admin edit user bad request response func (o *AdminEditUserBadRequest) Code() int { return 400 } func (o *AdminEditUserBadRequest) Error() string { return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserBadRequest", 400) } func (o *AdminEditUserBadRequest) String() string { return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserBadRequest", 400) } func (o *AdminEditUserBadRequest) 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 } // NewAdminEditUserForbidden creates a AdminEditUserForbidden with default headers values func NewAdminEditUserForbidden() *AdminEditUserForbidden { return &AdminEditUserForbidden{} } /* AdminEditUserForbidden describes a response with status code 403, with default header values. APIForbiddenError is a forbidden error response */ type AdminEditUserForbidden struct { Message string URL string } // IsSuccess returns true when this admin edit user forbidden response has a 2xx status code func (o *AdminEditUserForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this admin edit user forbidden response has a 3xx status code func (o *AdminEditUserForbidden) IsRedirect() bool { return false } // IsClientError returns true when this admin edit user forbidden response has a 4xx status code func (o *AdminEditUserForbidden) IsClientError() bool { return true } // IsServerError returns true when this admin edit user forbidden response has a 5xx status code func (o *AdminEditUserForbidden) IsServerError() bool { return false } // IsCode returns true when this admin edit user forbidden response a status code equal to that given func (o *AdminEditUserForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the admin edit user forbidden response func (o *AdminEditUserForbidden) Code() int { return 403 } func (o *AdminEditUserForbidden) Error() string { return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserForbidden", 403) } func (o *AdminEditUserForbidden) String() string { return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserForbidden", 403) } func (o *AdminEditUserForbidden) 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 } // NewAdminEditUserUnprocessableEntity creates a AdminEditUserUnprocessableEntity with default headers values func NewAdminEditUserUnprocessableEntity() *AdminEditUserUnprocessableEntity { return &AdminEditUserUnprocessableEntity{} } /* AdminEditUserUnprocessableEntity describes a response with status code 422, with default header values. APIValidationError is error format response related to input validation */ type AdminEditUserUnprocessableEntity struct { Message string URL string } // IsSuccess returns true when this admin edit user unprocessable entity response has a 2xx status code func (o *AdminEditUserUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this admin edit user unprocessable entity response has a 3xx status code func (o *AdminEditUserUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this admin edit user unprocessable entity response has a 4xx status code func (o *AdminEditUserUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this admin edit user unprocessable entity response has a 5xx status code func (o *AdminEditUserUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this admin edit user unprocessable entity response a status code equal to that given func (o *AdminEditUserUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the admin edit user unprocessable entity response func (o *AdminEditUserUnprocessableEntity) Code() int { return 422 } func (o *AdminEditUserUnprocessableEntity) Error() string { return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserUnprocessableEntity", 422) } func (o *AdminEditUserUnprocessableEntity) String() string { return fmt.Sprintf("[PATCH /admin/users/{username}][%d] adminEditUserUnprocessableEntity", 422) } func (o *AdminEditUserUnprocessableEntity) 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 }