// Code generated by go-swagger; DO NOT EDIT. package customer_management // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/Cyclops-Labs/cyclops-4-hpc.git/services/customerdb/models" ) // UpdateCustomerReader is a Reader for the UpdateCustomer structure. type UpdateCustomerReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *UpdateCustomerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewUpdateCustomerOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 202: result := NewUpdateCustomerAccepted() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 404: result := NewUpdateCustomerNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewUpdateCustomerInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } // NewUpdateCustomerOK creates a UpdateCustomerOK with default headers values func NewUpdateCustomerOK() *UpdateCustomerOK { return &UpdateCustomerOK{} } /*UpdateCustomerOK handles this case with default header values. Customer with the given id was updated */ type UpdateCustomerOK struct { Payload *models.ItemCreatedResponse } func (o *UpdateCustomerOK) Error() string { return fmt.Sprintf("[PUT /customer/{id}][%d] updateCustomerOK %+v", 200, o.Payload) } func (o *UpdateCustomerOK) GetPayload() *models.ItemCreatedResponse { return o.Payload } func (o *UpdateCustomerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ItemCreatedResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewUpdateCustomerAccepted creates a UpdateCustomerAccepted with default headers values func NewUpdateCustomerAccepted() *UpdateCustomerAccepted { return &UpdateCustomerAccepted{} } /*UpdateCustomerAccepted handles this case with default header values. The customer was updated but there might have been some fails when adding part of the data */ type UpdateCustomerAccepted struct { Payload *models.ItemCreatedResponse } func (o *UpdateCustomerAccepted) Error() string { return fmt.Sprintf("[PUT /customer/{id}][%d] updateCustomerAccepted %+v", 202, o.Payload) } func (o *UpdateCustomerAccepted) GetPayload() *models.ItemCreatedResponse { return o.Payload } func (o *UpdateCustomerAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ItemCreatedResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewUpdateCustomerNotFound creates a UpdateCustomerNotFound with default headers values func NewUpdateCustomerNotFound() *UpdateCustomerNotFound { return &UpdateCustomerNotFound{} } /*UpdateCustomerNotFound handles this case with default header values. The customer with the given id wasn't found */ type UpdateCustomerNotFound struct { Payload *models.ErrorResponse } func (o *UpdateCustomerNotFound) Error() string { return fmt.Sprintf("[PUT /customer/{id}][%d] updateCustomerNotFound %+v", 404, o.Payload) } func (o *UpdateCustomerNotFound) GetPayload() *models.ErrorResponse { return o.Payload } func (o *UpdateCustomerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ErrorResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewUpdateCustomerInternalServerError creates a UpdateCustomerInternalServerError with default headers values func NewUpdateCustomerInternalServerError() *UpdateCustomerInternalServerError { return &UpdateCustomerInternalServerError{} } /*UpdateCustomerInternalServerError handles this case with default header values. Something unexpected happend, error raised */ type UpdateCustomerInternalServerError struct { Payload *models.ErrorResponse } func (o *UpdateCustomerInternalServerError) Error() string { return fmt.Sprintf("[PUT /customer/{id}][%d] updateCustomerInternalServerError %+v", 500, o.Payload) } func (o *UpdateCustomerInternalServerError) GetPayload() *models.ErrorResponse { return o.Payload } func (o *UpdateCustomerInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ErrorResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }