// Code generated by go-swagger; DO NOT EDIT. // (c) 2012-2020 by Taxnexus, Inc. // All rights reserved worldwide. // Proprietary product; unlicensed use is not allowed package leads import ( "encoding/json" stderrors "errors" "fmt" "io" "code.tnxs.net/vernonkeenan/lib/api/crm/crm_models" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" ) // DeleteLeadReader is a Reader for the DeleteLead structure. type DeleteLeadReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *DeleteLeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewDeleteLeadOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewDeleteLeadUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewDeleteLeadForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewDeleteLeadNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewDeleteLeadUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewDeleteLeadInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[DELETE /leads] deleteLead", response, response.Code()) } } // NewDeleteLeadOK creates a DeleteLeadOK with default headers values func NewDeleteLeadOK() *DeleteLeadOK { return &DeleteLeadOK{} } // DeleteLeadOK describes a response with status code 200, with default header values. // // Response with Message Objects with Delete Status type DeleteLeadOK struct { AccessControlAllowOrigin string Payload *crm_models.DeleteResponse } // IsSuccess returns true when this delete lead o k response has a 2xx status code func (o *DeleteLeadOK) IsSuccess() bool { return true } // IsRedirect returns true when this delete lead o k response has a 3xx status code func (o *DeleteLeadOK) IsRedirect() bool { return false } // IsClientError returns true when this delete lead o k response has a 4xx status code func (o *DeleteLeadOK) IsClientError() bool { return false } // IsServerError returns true when this delete lead o k response has a 5xx status code func (o *DeleteLeadOK) IsServerError() bool { return false } // IsCode returns true when this delete lead o k response a status code equal to that given func (o *DeleteLeadOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the delete lead o k response func (o *DeleteLeadOK) Code() int { return 200 } func (o *DeleteLeadOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %s", 200, payload) } func (o *DeleteLeadOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %s", 200, payload) } func (o *DeleteLeadOK) GetPayload() *crm_models.DeleteResponse { return o.Payload } func (o *DeleteLeadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header Access-Control-Allow-Origin hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") if hdrAccessControlAllowOrigin != "" { o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin } o.Payload = new(crm_models.DeleteResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewDeleteLeadUnauthorized creates a DeleteLeadUnauthorized with default headers values func NewDeleteLeadUnauthorized() *DeleteLeadUnauthorized { return &DeleteLeadUnauthorized{} } // DeleteLeadUnauthorized describes a response with status code 401, with default header values. // // Access unauthorized, invalid API-KEY was used type DeleteLeadUnauthorized struct { AccessControlAllowOrigin string Payload *crm_models.Error } // IsSuccess returns true when this delete lead unauthorized response has a 2xx status code func (o *DeleteLeadUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this delete lead unauthorized response has a 3xx status code func (o *DeleteLeadUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this delete lead unauthorized response has a 4xx status code func (o *DeleteLeadUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this delete lead unauthorized response has a 5xx status code func (o *DeleteLeadUnauthorized) IsServerError() bool { return false } // IsCode returns true when this delete lead unauthorized response a status code equal to that given func (o *DeleteLeadUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the delete lead unauthorized response func (o *DeleteLeadUnauthorized) Code() int { return 401 } func (o *DeleteLeadUnauthorized) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %s", 401, payload) } func (o *DeleteLeadUnauthorized) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %s", 401, payload) } func (o *DeleteLeadUnauthorized) GetPayload() *crm_models.Error { return o.Payload } func (o *DeleteLeadUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header Access-Control-Allow-Origin hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") if hdrAccessControlAllowOrigin != "" { o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin } o.Payload = new(crm_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewDeleteLeadForbidden creates a DeleteLeadForbidden with default headers values func NewDeleteLeadForbidden() *DeleteLeadForbidden { return &DeleteLeadForbidden{} } // DeleteLeadForbidden describes a response with status code 403, with default header values. // // Access forbidden, account lacks access type DeleteLeadForbidden struct { AccessControlAllowOrigin string Payload *crm_models.Error } // IsSuccess returns true when this delete lead forbidden response has a 2xx status code func (o *DeleteLeadForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this delete lead forbidden response has a 3xx status code func (o *DeleteLeadForbidden) IsRedirect() bool { return false } // IsClientError returns true when this delete lead forbidden response has a 4xx status code func (o *DeleteLeadForbidden) IsClientError() bool { return true } // IsServerError returns true when this delete lead forbidden response has a 5xx status code func (o *DeleteLeadForbidden) IsServerError() bool { return false } // IsCode returns true when this delete lead forbidden response a status code equal to that given func (o *DeleteLeadForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the delete lead forbidden response func (o *DeleteLeadForbidden) Code() int { return 403 } func (o *DeleteLeadForbidden) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %s", 403, payload) } func (o *DeleteLeadForbidden) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %s", 403, payload) } func (o *DeleteLeadForbidden) GetPayload() *crm_models.Error { return o.Payload } func (o *DeleteLeadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header Access-Control-Allow-Origin hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") if hdrAccessControlAllowOrigin != "" { o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin } o.Payload = new(crm_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewDeleteLeadNotFound creates a DeleteLeadNotFound with default headers values func NewDeleteLeadNotFound() *DeleteLeadNotFound { return &DeleteLeadNotFound{} } // DeleteLeadNotFound describes a response with status code 404, with default header values. // // Resource was not found type DeleteLeadNotFound struct { AccessControlAllowOrigin string Payload *crm_models.Error } // IsSuccess returns true when this delete lead not found response has a 2xx status code func (o *DeleteLeadNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this delete lead not found response has a 3xx status code func (o *DeleteLeadNotFound) IsRedirect() bool { return false } // IsClientError returns true when this delete lead not found response has a 4xx status code func (o *DeleteLeadNotFound) IsClientError() bool { return true } // IsServerError returns true when this delete lead not found response has a 5xx status code func (o *DeleteLeadNotFound) IsServerError() bool { return false } // IsCode returns true when this delete lead not found response a status code equal to that given func (o *DeleteLeadNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the delete lead not found response func (o *DeleteLeadNotFound) Code() int { return 404 } func (o *DeleteLeadNotFound) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %s", 404, payload) } func (o *DeleteLeadNotFound) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %s", 404, payload) } func (o *DeleteLeadNotFound) GetPayload() *crm_models.Error { return o.Payload } func (o *DeleteLeadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header Access-Control-Allow-Origin hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") if hdrAccessControlAllowOrigin != "" { o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin } o.Payload = new(crm_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewDeleteLeadUnprocessableEntity creates a DeleteLeadUnprocessableEntity with default headers values func NewDeleteLeadUnprocessableEntity() *DeleteLeadUnprocessableEntity { return &DeleteLeadUnprocessableEntity{} } // DeleteLeadUnprocessableEntity describes a response with status code 422, with default header values. // // Unprocessable Entity, likely a bad parameter type DeleteLeadUnprocessableEntity struct { AccessControlAllowOrigin string Payload *crm_models.Error } // IsSuccess returns true when this delete lead unprocessable entity response has a 2xx status code func (o *DeleteLeadUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this delete lead unprocessable entity response has a 3xx status code func (o *DeleteLeadUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this delete lead unprocessable entity response has a 4xx status code func (o *DeleteLeadUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this delete lead unprocessable entity response has a 5xx status code func (o *DeleteLeadUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this delete lead unprocessable entity response a status code equal to that given func (o *DeleteLeadUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the delete lead unprocessable entity response func (o *DeleteLeadUnprocessableEntity) Code() int { return 422 } func (o *DeleteLeadUnprocessableEntity) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %s", 422, payload) } func (o *DeleteLeadUnprocessableEntity) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %s", 422, payload) } func (o *DeleteLeadUnprocessableEntity) GetPayload() *crm_models.Error { return o.Payload } func (o *DeleteLeadUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header Access-Control-Allow-Origin hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") if hdrAccessControlAllowOrigin != "" { o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin } o.Payload = new(crm_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewDeleteLeadInternalServerError creates a DeleteLeadInternalServerError with default headers values func NewDeleteLeadInternalServerError() *DeleteLeadInternalServerError { return &DeleteLeadInternalServerError{} } // DeleteLeadInternalServerError describes a response with status code 500, with default header values. // // Server Internal Error type DeleteLeadInternalServerError struct { AccessControlAllowOrigin string Payload *crm_models.Error } // IsSuccess returns true when this delete lead internal server error response has a 2xx status code func (o *DeleteLeadInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this delete lead internal server error response has a 3xx status code func (o *DeleteLeadInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this delete lead internal server error response has a 4xx status code func (o *DeleteLeadInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this delete lead internal server error response has a 5xx status code func (o *DeleteLeadInternalServerError) IsServerError() bool { return true } // IsCode returns true when this delete lead internal server error response a status code equal to that given func (o *DeleteLeadInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the delete lead internal server error response func (o *DeleteLeadInternalServerError) Code() int { return 500 } func (o *DeleteLeadInternalServerError) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %s", 500, payload) } func (o *DeleteLeadInternalServerError) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %s", 500, payload) } func (o *DeleteLeadInternalServerError) GetPayload() *crm_models.Error { return o.Payload } func (o *DeleteLeadInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // hydrates response header Access-Control-Allow-Origin hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin") if hdrAccessControlAllowOrigin != "" { o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin } o.Payload = new(crm_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil }