// 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" "git.coopcloud.tech/decentral1se/gtslib/models" ) // RuleDeleteReader is a Reader for the RuleDelete structure. type RuleDeleteReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *RuleDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewRuleDeleteOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewRuleDeleteBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 401: result := NewRuleDeleteUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewRuleDeleteForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewRuleDeleteNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 406: result := NewRuleDeleteNotAcceptable() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewRuleDeleteInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[DELETE /api/v1/admin/instance/rules/{id}] ruleDelete", response, response.Code()) } } // NewRuleDeleteOK creates a RuleDeleteOK with default headers values func NewRuleDeleteOK() *RuleDeleteOK { return &RuleDeleteOK{} } /* RuleDeleteOK describes a response with status code 200, with default header values. The deleted instance rule. */ type RuleDeleteOK struct { Payload *models.InstanceRule } // IsSuccess returns true when this rule delete o k response has a 2xx status code func (o *RuleDeleteOK) IsSuccess() bool { return true } // IsRedirect returns true when this rule delete o k response has a 3xx status code func (o *RuleDeleteOK) IsRedirect() bool { return false } // IsClientError returns true when this rule delete o k response has a 4xx status code func (o *RuleDeleteOK) IsClientError() bool { return false } // IsServerError returns true when this rule delete o k response has a 5xx status code func (o *RuleDeleteOK) IsServerError() bool { return false } // IsCode returns true when this rule delete o k response a status code equal to that given func (o *RuleDeleteOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the rule delete o k response func (o *RuleDeleteOK) Code() int { return 200 } func (o *RuleDeleteOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteOK %s", 200, payload) } func (o *RuleDeleteOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteOK %s", 200, payload) } func (o *RuleDeleteOK) GetPayload() *models.InstanceRule { return o.Payload } func (o *RuleDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.InstanceRule) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewRuleDeleteBadRequest creates a RuleDeleteBadRequest with default headers values func NewRuleDeleteBadRequest() *RuleDeleteBadRequest { return &RuleDeleteBadRequest{} } /* RuleDeleteBadRequest describes a response with status code 400, with default header values. bad request */ type RuleDeleteBadRequest struct { } // IsSuccess returns true when this rule delete bad request response has a 2xx status code func (o *RuleDeleteBadRequest) IsSuccess() bool { return false } // IsRedirect returns true when this rule delete bad request response has a 3xx status code func (o *RuleDeleteBadRequest) IsRedirect() bool { return false } // IsClientError returns true when this rule delete bad request response has a 4xx status code func (o *RuleDeleteBadRequest) IsClientError() bool { return true } // IsServerError returns true when this rule delete bad request response has a 5xx status code func (o *RuleDeleteBadRequest) IsServerError() bool { return false } // IsCode returns true when this rule delete bad request response a status code equal to that given func (o *RuleDeleteBadRequest) IsCode(code int) bool { return code == 400 } // Code gets the status code for the rule delete bad request response func (o *RuleDeleteBadRequest) Code() int { return 400 } func (o *RuleDeleteBadRequest) Error() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteBadRequest", 400) } func (o *RuleDeleteBadRequest) String() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteBadRequest", 400) } func (o *RuleDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewRuleDeleteUnauthorized creates a RuleDeleteUnauthorized with default headers values func NewRuleDeleteUnauthorized() *RuleDeleteUnauthorized { return &RuleDeleteUnauthorized{} } /* RuleDeleteUnauthorized describes a response with status code 401, with default header values. unauthorized */ type RuleDeleteUnauthorized struct { } // IsSuccess returns true when this rule delete unauthorized response has a 2xx status code func (o *RuleDeleteUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this rule delete unauthorized response has a 3xx status code func (o *RuleDeleteUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this rule delete unauthorized response has a 4xx status code func (o *RuleDeleteUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this rule delete unauthorized response has a 5xx status code func (o *RuleDeleteUnauthorized) IsServerError() bool { return false } // IsCode returns true when this rule delete unauthorized response a status code equal to that given func (o *RuleDeleteUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the rule delete unauthorized response func (o *RuleDeleteUnauthorized) Code() int { return 401 } func (o *RuleDeleteUnauthorized) Error() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteUnauthorized", 401) } func (o *RuleDeleteUnauthorized) String() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteUnauthorized", 401) } func (o *RuleDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewRuleDeleteForbidden creates a RuleDeleteForbidden with default headers values func NewRuleDeleteForbidden() *RuleDeleteForbidden { return &RuleDeleteForbidden{} } /* RuleDeleteForbidden describes a response with status code 403, with default header values. forbidden */ type RuleDeleteForbidden struct { } // IsSuccess returns true when this rule delete forbidden response has a 2xx status code func (o *RuleDeleteForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this rule delete forbidden response has a 3xx status code func (o *RuleDeleteForbidden) IsRedirect() bool { return false } // IsClientError returns true when this rule delete forbidden response has a 4xx status code func (o *RuleDeleteForbidden) IsClientError() bool { return true } // IsServerError returns true when this rule delete forbidden response has a 5xx status code func (o *RuleDeleteForbidden) IsServerError() bool { return false } // IsCode returns true when this rule delete forbidden response a status code equal to that given func (o *RuleDeleteForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the rule delete forbidden response func (o *RuleDeleteForbidden) Code() int { return 403 } func (o *RuleDeleteForbidden) Error() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteForbidden", 403) } func (o *RuleDeleteForbidden) String() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteForbidden", 403) } func (o *RuleDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewRuleDeleteNotFound creates a RuleDeleteNotFound with default headers values func NewRuleDeleteNotFound() *RuleDeleteNotFound { return &RuleDeleteNotFound{} } /* RuleDeleteNotFound describes a response with status code 404, with default header values. not found */ type RuleDeleteNotFound struct { } // IsSuccess returns true when this rule delete not found response has a 2xx status code func (o *RuleDeleteNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this rule delete not found response has a 3xx status code func (o *RuleDeleteNotFound) IsRedirect() bool { return false } // IsClientError returns true when this rule delete not found response has a 4xx status code func (o *RuleDeleteNotFound) IsClientError() bool { return true } // IsServerError returns true when this rule delete not found response has a 5xx status code func (o *RuleDeleteNotFound) IsServerError() bool { return false } // IsCode returns true when this rule delete not found response a status code equal to that given func (o *RuleDeleteNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the rule delete not found response func (o *RuleDeleteNotFound) Code() int { return 404 } func (o *RuleDeleteNotFound) Error() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteNotFound", 404) } func (o *RuleDeleteNotFound) String() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteNotFound", 404) } func (o *RuleDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewRuleDeleteNotAcceptable creates a RuleDeleteNotAcceptable with default headers values func NewRuleDeleteNotAcceptable() *RuleDeleteNotAcceptable { return &RuleDeleteNotAcceptable{} } /* RuleDeleteNotAcceptable describes a response with status code 406, with default header values. not acceptable */ type RuleDeleteNotAcceptable struct { } // IsSuccess returns true when this rule delete not acceptable response has a 2xx status code func (o *RuleDeleteNotAcceptable) IsSuccess() bool { return false } // IsRedirect returns true when this rule delete not acceptable response has a 3xx status code func (o *RuleDeleteNotAcceptable) IsRedirect() bool { return false } // IsClientError returns true when this rule delete not acceptable response has a 4xx status code func (o *RuleDeleteNotAcceptable) IsClientError() bool { return true } // IsServerError returns true when this rule delete not acceptable response has a 5xx status code func (o *RuleDeleteNotAcceptable) IsServerError() bool { return false } // IsCode returns true when this rule delete not acceptable response a status code equal to that given func (o *RuleDeleteNotAcceptable) IsCode(code int) bool { return code == 406 } // Code gets the status code for the rule delete not acceptable response func (o *RuleDeleteNotAcceptable) Code() int { return 406 } func (o *RuleDeleteNotAcceptable) Error() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteNotAcceptable", 406) } func (o *RuleDeleteNotAcceptable) String() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteNotAcceptable", 406) } func (o *RuleDeleteNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewRuleDeleteInternalServerError creates a RuleDeleteInternalServerError with default headers values func NewRuleDeleteInternalServerError() *RuleDeleteInternalServerError { return &RuleDeleteInternalServerError{} } /* RuleDeleteInternalServerError describes a response with status code 500, with default header values. internal server error */ type RuleDeleteInternalServerError struct { } // IsSuccess returns true when this rule delete internal server error response has a 2xx status code func (o *RuleDeleteInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this rule delete internal server error response has a 3xx status code func (o *RuleDeleteInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this rule delete internal server error response has a 4xx status code func (o *RuleDeleteInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this rule delete internal server error response has a 5xx status code func (o *RuleDeleteInternalServerError) IsServerError() bool { return true } // IsCode returns true when this rule delete internal server error response a status code equal to that given func (o *RuleDeleteInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the rule delete internal server error response func (o *RuleDeleteInternalServerError) Code() int { return 500 } func (o *RuleDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteInternalServerError", 500) } func (o *RuleDeleteInternalServerError) String() string { return fmt.Sprintf("[DELETE /api/v1/admin/instance/rules/{id}][%d] ruleDeleteInternalServerError", 500) } func (o *RuleDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil }