| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| package replication |
|
|
| |
| |
|
|
| import ( |
| "fmt" |
| "io" |
|
|
| "github.com/go-openapi/runtime" |
| "github.com/go-openapi/strfmt" |
|
|
| "github.com/weaviate/weaviate/entities/models" |
| ) |
|
|
| |
| type ReplicateReader struct { |
| formats strfmt.Registry |
| } |
|
|
| |
| func (o *ReplicateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { |
| switch response.Code() { |
| case 200: |
| result := NewReplicateOK() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return result, nil |
| case 400: |
| result := NewReplicateBadRequest() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return nil, result |
| case 401: |
| result := NewReplicateUnauthorized() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return nil, result |
| case 403: |
| result := NewReplicateForbidden() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return nil, result |
| case 422: |
| result := NewReplicateUnprocessableEntity() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return nil, result |
| case 500: |
| result := NewReplicateInternalServerError() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return nil, result |
| case 501: |
| result := NewReplicateNotImplemented() |
| if err := result.readResponse(response, consumer, o.formats); err != nil { |
| return nil, err |
| } |
| return nil, result |
| default: |
| return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) |
| } |
| } |
|
|
| |
| func NewReplicateOK() *ReplicateOK { |
| return &ReplicateOK{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateOK struct { |
| Payload *models.ReplicationReplicateReplicaResponse |
| } |
|
|
| |
| func (o *ReplicateOK) IsSuccess() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateOK) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateOK) IsClientError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateOK) IsServerError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateOK) IsCode(code int) bool { |
| return code == 200 |
| } |
|
|
| |
| func (o *ReplicateOK) Code() int { |
| return 200 |
| } |
|
|
| func (o *ReplicateOK) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateOK %+v", 200, o.Payload) |
| } |
|
|
| func (o *ReplicateOK) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateOK %+v", 200, o.Payload) |
| } |
|
|
| func (o *ReplicateOK) GetPayload() *models.ReplicationReplicateReplicaResponse { |
| return o.Payload |
| } |
|
|
| func (o *ReplicateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| o.Payload = new(models.ReplicationReplicateReplicaResponse) |
|
|
| |
| if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| |
| func NewReplicateBadRequest() *ReplicateBadRequest { |
| return &ReplicateBadRequest{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateBadRequest struct { |
| Payload *models.ErrorResponse |
| } |
|
|
| |
| func (o *ReplicateBadRequest) IsSuccess() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateBadRequest) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateBadRequest) IsClientError() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateBadRequest) IsServerError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateBadRequest) IsCode(code int) bool { |
| return code == 400 |
| } |
|
|
| |
| func (o *ReplicateBadRequest) Code() int { |
| return 400 |
| } |
|
|
| func (o *ReplicateBadRequest) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateBadRequest %+v", 400, o.Payload) |
| } |
|
|
| func (o *ReplicateBadRequest) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateBadRequest %+v", 400, o.Payload) |
| } |
|
|
| func (o *ReplicateBadRequest) GetPayload() *models.ErrorResponse { |
| return o.Payload |
| } |
|
|
| func (o *ReplicateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| o.Payload = new(models.ErrorResponse) |
|
|
| |
| if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| |
| func NewReplicateUnauthorized() *ReplicateUnauthorized { |
| return &ReplicateUnauthorized{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateUnauthorized struct { |
| } |
|
|
| |
| func (o *ReplicateUnauthorized) IsSuccess() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateUnauthorized) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateUnauthorized) IsClientError() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateUnauthorized) IsServerError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateUnauthorized) IsCode(code int) bool { |
| return code == 401 |
| } |
|
|
| |
| func (o *ReplicateUnauthorized) Code() int { |
| return 401 |
| } |
|
|
| func (o *ReplicateUnauthorized) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateUnauthorized ", 401) |
| } |
|
|
| func (o *ReplicateUnauthorized) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateUnauthorized ", 401) |
| } |
|
|
| func (o *ReplicateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| return nil |
| } |
|
|
| |
| func NewReplicateForbidden() *ReplicateForbidden { |
| return &ReplicateForbidden{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateForbidden struct { |
| Payload *models.ErrorResponse |
| } |
|
|
| |
| func (o *ReplicateForbidden) IsSuccess() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateForbidden) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateForbidden) IsClientError() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateForbidden) IsServerError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateForbidden) IsCode(code int) bool { |
| return code == 403 |
| } |
|
|
| |
| func (o *ReplicateForbidden) Code() int { |
| return 403 |
| } |
|
|
| func (o *ReplicateForbidden) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateForbidden %+v", 403, o.Payload) |
| } |
|
|
| func (o *ReplicateForbidden) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateForbidden %+v", 403, o.Payload) |
| } |
|
|
| func (o *ReplicateForbidden) GetPayload() *models.ErrorResponse { |
| return o.Payload |
| } |
|
|
| func (o *ReplicateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| o.Payload = new(models.ErrorResponse) |
|
|
| |
| if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| |
| func NewReplicateUnprocessableEntity() *ReplicateUnprocessableEntity { |
| return &ReplicateUnprocessableEntity{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateUnprocessableEntity struct { |
| Payload *models.ErrorResponse |
| } |
|
|
| |
| func (o *ReplicateUnprocessableEntity) IsSuccess() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateUnprocessableEntity) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateUnprocessableEntity) IsClientError() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateUnprocessableEntity) IsServerError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateUnprocessableEntity) IsCode(code int) bool { |
| return code == 422 |
| } |
|
|
| |
| func (o *ReplicateUnprocessableEntity) Code() int { |
| return 422 |
| } |
|
|
| func (o *ReplicateUnprocessableEntity) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateUnprocessableEntity %+v", 422, o.Payload) |
| } |
|
|
| func (o *ReplicateUnprocessableEntity) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateUnprocessableEntity %+v", 422, o.Payload) |
| } |
|
|
| func (o *ReplicateUnprocessableEntity) GetPayload() *models.ErrorResponse { |
| return o.Payload |
| } |
|
|
| func (o *ReplicateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| o.Payload = new(models.ErrorResponse) |
|
|
| |
| if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| |
| func NewReplicateInternalServerError() *ReplicateInternalServerError { |
| return &ReplicateInternalServerError{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateInternalServerError struct { |
| Payload *models.ErrorResponse |
| } |
|
|
| |
| func (o *ReplicateInternalServerError) IsSuccess() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateInternalServerError) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateInternalServerError) IsClientError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateInternalServerError) IsServerError() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateInternalServerError) IsCode(code int) bool { |
| return code == 500 |
| } |
|
|
| |
| func (o *ReplicateInternalServerError) Code() int { |
| return 500 |
| } |
|
|
| func (o *ReplicateInternalServerError) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateInternalServerError %+v", 500, o.Payload) |
| } |
|
|
| func (o *ReplicateInternalServerError) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateInternalServerError %+v", 500, o.Payload) |
| } |
|
|
| func (o *ReplicateInternalServerError) GetPayload() *models.ErrorResponse { |
| return o.Payload |
| } |
|
|
| func (o *ReplicateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| o.Payload = new(models.ErrorResponse) |
|
|
| |
| if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| |
| func NewReplicateNotImplemented() *ReplicateNotImplemented { |
| return &ReplicateNotImplemented{} |
| } |
|
|
| |
| |
| |
| |
| |
| type ReplicateNotImplemented struct { |
| Payload *models.ErrorResponse |
| } |
|
|
| |
| func (o *ReplicateNotImplemented) IsSuccess() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateNotImplemented) IsRedirect() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateNotImplemented) IsClientError() bool { |
| return false |
| } |
|
|
| |
| func (o *ReplicateNotImplemented) IsServerError() bool { |
| return true |
| } |
|
|
| |
| func (o *ReplicateNotImplemented) IsCode(code int) bool { |
| return code == 501 |
| } |
|
|
| |
| func (o *ReplicateNotImplemented) Code() int { |
| return 501 |
| } |
|
|
| func (o *ReplicateNotImplemented) Error() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateNotImplemented %+v", 501, o.Payload) |
| } |
|
|
| func (o *ReplicateNotImplemented) String() string { |
| return fmt.Sprintf("[POST /replication/replicate][%d] replicateNotImplemented %+v", 501, o.Payload) |
| } |
|
|
| func (o *ReplicateNotImplemented) GetPayload() *models.ErrorResponse { |
| return o.Payload |
| } |
|
|
| func (o *ReplicateNotImplemented) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { |
|
|
| o.Payload = new(models.ErrorResponse) |
|
|
| |
| if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { |
| return err |
| } |
|
|
| return nil |
| } |
|
|