291 lines
9.2 KiB
Go
291 lines
9.2 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"
|
||
|
)
|
||
|
|
||
|
// CreateUserVariableReader is a Reader for the CreateUserVariable structure.
|
||
|
type CreateUserVariableReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *CreateUserVariableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 201:
|
||
|
result := NewCreateUserVariableCreated()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 204:
|
||
|
result := NewCreateUserVariableNoContent()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 400:
|
||
|
result := NewCreateUserVariableBadRequest()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewCreateUserVariableNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
default:
|
||
|
return nil, runtime.NewAPIError("[POST /user/actions/variables/{variablename}] createUserVariable", response, response.Code())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewCreateUserVariableCreated creates a CreateUserVariableCreated with default headers values
|
||
|
func NewCreateUserVariableCreated() *CreateUserVariableCreated {
|
||
|
return &CreateUserVariableCreated{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
CreateUserVariableCreated describes a response with status code 201, with default header values.
|
||
|
|
||
|
response when creating a variable
|
||
|
*/
|
||
|
type CreateUserVariableCreated struct {
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this create user variable created response has a 2xx status code
|
||
|
func (o *CreateUserVariableCreated) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this create user variable created response has a 3xx status code
|
||
|
func (o *CreateUserVariableCreated) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this create user variable created response has a 4xx status code
|
||
|
func (o *CreateUserVariableCreated) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this create user variable created response has a 5xx status code
|
||
|
func (o *CreateUserVariableCreated) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this create user variable created response a status code equal to that given
|
||
|
func (o *CreateUserVariableCreated) IsCode(code int) bool {
|
||
|
return code == 201
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the create user variable created response
|
||
|
func (o *CreateUserVariableCreated) Code() int {
|
||
|
return 201
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableCreated) Error() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableCreated", 201)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableCreated) String() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableCreated", 201)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewCreateUserVariableNoContent creates a CreateUserVariableNoContent with default headers values
|
||
|
func NewCreateUserVariableNoContent() *CreateUserVariableNoContent {
|
||
|
return &CreateUserVariableNoContent{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
CreateUserVariableNoContent describes a response with status code 204, with default header values.
|
||
|
|
||
|
response when creating a variable
|
||
|
*/
|
||
|
type CreateUserVariableNoContent struct {
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this create user variable no content response has a 2xx status code
|
||
|
func (o *CreateUserVariableNoContent) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this create user variable no content response has a 3xx status code
|
||
|
func (o *CreateUserVariableNoContent) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this create user variable no content response has a 4xx status code
|
||
|
func (o *CreateUserVariableNoContent) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this create user variable no content response has a 5xx status code
|
||
|
func (o *CreateUserVariableNoContent) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this create user variable no content response a status code equal to that given
|
||
|
func (o *CreateUserVariableNoContent) IsCode(code int) bool {
|
||
|
return code == 204
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the create user variable no content response
|
||
|
func (o *CreateUserVariableNoContent) Code() int {
|
||
|
return 204
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableNoContent) Error() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableNoContent", 204)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableNoContent) String() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableNoContent", 204)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewCreateUserVariableBadRequest creates a CreateUserVariableBadRequest with default headers values
|
||
|
func NewCreateUserVariableBadRequest() *CreateUserVariableBadRequest {
|
||
|
return &CreateUserVariableBadRequest{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
CreateUserVariableBadRequest describes a response with status code 400, with default header values.
|
||
|
|
||
|
APIError is error format response
|
||
|
*/
|
||
|
type CreateUserVariableBadRequest struct {
|
||
|
Message string
|
||
|
URL string
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this create user variable bad request response has a 2xx status code
|
||
|
func (o *CreateUserVariableBadRequest) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this create user variable bad request response has a 3xx status code
|
||
|
func (o *CreateUserVariableBadRequest) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this create user variable bad request response has a 4xx status code
|
||
|
func (o *CreateUserVariableBadRequest) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this create user variable bad request response has a 5xx status code
|
||
|
func (o *CreateUserVariableBadRequest) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this create user variable bad request response a status code equal to that given
|
||
|
func (o *CreateUserVariableBadRequest) IsCode(code int) bool {
|
||
|
return code == 400
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the create user variable bad request response
|
||
|
func (o *CreateUserVariableBadRequest) Code() int {
|
||
|
return 400
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableBadRequest) Error() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableBadRequest", 400)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableBadRequest) String() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableBadRequest", 400)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableBadRequest) 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
|
||
|
}
|
||
|
|
||
|
// NewCreateUserVariableNotFound creates a CreateUserVariableNotFound with default headers values
|
||
|
func NewCreateUserVariableNotFound() *CreateUserVariableNotFound {
|
||
|
return &CreateUserVariableNotFound{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
CreateUserVariableNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
APINotFound is a not found empty response
|
||
|
*/
|
||
|
type CreateUserVariableNotFound struct {
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this create user variable not found response has a 2xx status code
|
||
|
func (o *CreateUserVariableNotFound) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this create user variable not found response has a 3xx status code
|
||
|
func (o *CreateUserVariableNotFound) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this create user variable not found response has a 4xx status code
|
||
|
func (o *CreateUserVariableNotFound) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this create user variable not found response has a 5xx status code
|
||
|
func (o *CreateUserVariableNotFound) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this create user variable not found response a status code equal to that given
|
||
|
func (o *CreateUserVariableNotFound) IsCode(code int) bool {
|
||
|
return code == 404
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the create user variable not found response
|
||
|
func (o *CreateUserVariableNotFound) Code() int {
|
||
|
return 404
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableNotFound) Error() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableNotFound", 404)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableNotFound) String() string {
|
||
|
return fmt.Sprintf("[POST /user/actions/variables/{variablename}][%d] createUserVariableNotFound", 404)
|
||
|
}
|
||
|
|
||
|
func (o *CreateUserVariableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
return nil
|
||
|
}
|