// 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" ) // AdminRuleGetReader is a Reader for the AdminRuleGet structure. type AdminRuleGetReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *AdminRuleGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewAdminRuleGetOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewAdminRuleGetBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 401: result := NewAdminRuleGetUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewAdminRuleGetNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 406: result := NewAdminRuleGetNotAcceptable() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewAdminRuleGetInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[GET /api/v1/admin/rules/{id}] adminRuleGet", response, response.Code()) } } // NewAdminRuleGetOK creates a AdminRuleGetOK with default headers values func NewAdminRuleGetOK() *AdminRuleGetOK { return &AdminRuleGetOK{} } /* AdminRuleGetOK describes a response with status code 200, with default header values. The requested rule. */ type AdminRuleGetOK struct { Payload *models.InstanceRule } // IsSuccess returns true when this admin rule get o k response has a 2xx status code func (o *AdminRuleGetOK) IsSuccess() bool { return true } // IsRedirect returns true when this admin rule get o k response has a 3xx status code func (o *AdminRuleGetOK) IsRedirect() bool { return false } // IsClientError returns true when this admin rule get o k response has a 4xx status code func (o *AdminRuleGetOK) IsClientError() bool { return false } // IsServerError returns true when this admin rule get o k response has a 5xx status code func (o *AdminRuleGetOK) IsServerError() bool { return false } // IsCode returns true when this admin rule get o k response a status code equal to that given func (o *AdminRuleGetOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the admin rule get o k response func (o *AdminRuleGetOK) Code() int { return 200 } func (o *AdminRuleGetOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetOK %s", 200, payload) } func (o *AdminRuleGetOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetOK %s", 200, payload) } func (o *AdminRuleGetOK) GetPayload() *models.InstanceRule { return o.Payload } func (o *AdminRuleGetOK) 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 } // NewAdminRuleGetBadRequest creates a AdminRuleGetBadRequest with default headers values func NewAdminRuleGetBadRequest() *AdminRuleGetBadRequest { return &AdminRuleGetBadRequest{} } /* AdminRuleGetBadRequest describes a response with status code 400, with default header values. bad request */ type AdminRuleGetBadRequest struct { } // IsSuccess returns true when this admin rule get bad request response has a 2xx status code func (o *AdminRuleGetBadRequest) IsSuccess() bool { return false } // IsRedirect returns true when this admin rule get bad request response has a 3xx status code func (o *AdminRuleGetBadRequest) IsRedirect() bool { return false } // IsClientError returns true when this admin rule get bad request response has a 4xx status code func (o *AdminRuleGetBadRequest) IsClientError() bool { return true } // IsServerError returns true when this admin rule get bad request response has a 5xx status code func (o *AdminRuleGetBadRequest) IsServerError() bool { return false } // IsCode returns true when this admin rule get bad request response a status code equal to that given func (o *AdminRuleGetBadRequest) IsCode(code int) bool { return code == 400 } // Code gets the status code for the admin rule get bad request response func (o *AdminRuleGetBadRequest) Code() int { return 400 } func (o *AdminRuleGetBadRequest) Error() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetBadRequest", 400) } func (o *AdminRuleGetBadRequest) String() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetBadRequest", 400) } func (o *AdminRuleGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewAdminRuleGetUnauthorized creates a AdminRuleGetUnauthorized with default headers values func NewAdminRuleGetUnauthorized() *AdminRuleGetUnauthorized { return &AdminRuleGetUnauthorized{} } /* AdminRuleGetUnauthorized describes a response with status code 401, with default header values. unauthorized */ type AdminRuleGetUnauthorized struct { } // IsSuccess returns true when this admin rule get unauthorized response has a 2xx status code func (o *AdminRuleGetUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this admin rule get unauthorized response has a 3xx status code func (o *AdminRuleGetUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this admin rule get unauthorized response has a 4xx status code func (o *AdminRuleGetUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this admin rule get unauthorized response has a 5xx status code func (o *AdminRuleGetUnauthorized) IsServerError() bool { return false } // IsCode returns true when this admin rule get unauthorized response a status code equal to that given func (o *AdminRuleGetUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the admin rule get unauthorized response func (o *AdminRuleGetUnauthorized) Code() int { return 401 } func (o *AdminRuleGetUnauthorized) Error() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetUnauthorized", 401) } func (o *AdminRuleGetUnauthorized) String() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetUnauthorized", 401) } func (o *AdminRuleGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewAdminRuleGetNotFound creates a AdminRuleGetNotFound with default headers values func NewAdminRuleGetNotFound() *AdminRuleGetNotFound { return &AdminRuleGetNotFound{} } /* AdminRuleGetNotFound describes a response with status code 404, with default header values. not found */ type AdminRuleGetNotFound struct { } // IsSuccess returns true when this admin rule get not found response has a 2xx status code func (o *AdminRuleGetNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this admin rule get not found response has a 3xx status code func (o *AdminRuleGetNotFound) IsRedirect() bool { return false } // IsClientError returns true when this admin rule get not found response has a 4xx status code func (o *AdminRuleGetNotFound) IsClientError() bool { return true } // IsServerError returns true when this admin rule get not found response has a 5xx status code func (o *AdminRuleGetNotFound) IsServerError() bool { return false } // IsCode returns true when this admin rule get not found response a status code equal to that given func (o *AdminRuleGetNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the admin rule get not found response func (o *AdminRuleGetNotFound) Code() int { return 404 } func (o *AdminRuleGetNotFound) Error() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetNotFound", 404) } func (o *AdminRuleGetNotFound) String() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetNotFound", 404) } func (o *AdminRuleGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewAdminRuleGetNotAcceptable creates a AdminRuleGetNotAcceptable with default headers values func NewAdminRuleGetNotAcceptable() *AdminRuleGetNotAcceptable { return &AdminRuleGetNotAcceptable{} } /* AdminRuleGetNotAcceptable describes a response with status code 406, with default header values. not acceptable */ type AdminRuleGetNotAcceptable struct { } // IsSuccess returns true when this admin rule get not acceptable response has a 2xx status code func (o *AdminRuleGetNotAcceptable) IsSuccess() bool { return false } // IsRedirect returns true when this admin rule get not acceptable response has a 3xx status code func (o *AdminRuleGetNotAcceptable) IsRedirect() bool { return false } // IsClientError returns true when this admin rule get not acceptable response has a 4xx status code func (o *AdminRuleGetNotAcceptable) IsClientError() bool { return true } // IsServerError returns true when this admin rule get not acceptable response has a 5xx status code func (o *AdminRuleGetNotAcceptable) IsServerError() bool { return false } // IsCode returns true when this admin rule get not acceptable response a status code equal to that given func (o *AdminRuleGetNotAcceptable) IsCode(code int) bool { return code == 406 } // Code gets the status code for the admin rule get not acceptable response func (o *AdminRuleGetNotAcceptable) Code() int { return 406 } func (o *AdminRuleGetNotAcceptable) Error() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetNotAcceptable", 406) } func (o *AdminRuleGetNotAcceptable) String() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetNotAcceptable", 406) } func (o *AdminRuleGetNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewAdminRuleGetInternalServerError creates a AdminRuleGetInternalServerError with default headers values func NewAdminRuleGetInternalServerError() *AdminRuleGetInternalServerError { return &AdminRuleGetInternalServerError{} } /* AdminRuleGetInternalServerError describes a response with status code 500, with default header values. internal server error */ type AdminRuleGetInternalServerError struct { } // IsSuccess returns true when this admin rule get internal server error response has a 2xx status code func (o *AdminRuleGetInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this admin rule get internal server error response has a 3xx status code func (o *AdminRuleGetInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this admin rule get internal server error response has a 4xx status code func (o *AdminRuleGetInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this admin rule get internal server error response has a 5xx status code func (o *AdminRuleGetInternalServerError) IsServerError() bool { return true } // IsCode returns true when this admin rule get internal server error response a status code equal to that given func (o *AdminRuleGetInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the admin rule get internal server error response func (o *AdminRuleGetInternalServerError) Code() int { return 500 } func (o *AdminRuleGetInternalServerError) Error() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetInternalServerError", 500) } func (o *AdminRuleGetInternalServerError) String() string { return fmt.Sprintf("[GET /api/v1/admin/rules/{id}][%d] adminRuleGetInternalServerError", 500) } func (o *AdminRuleGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil }