// Code generated by go-swagger; DO NOT EDIT. // All Code Copyright(c) 2018-2020 by Taxnexus, Inc. // All rights reserved worldwide. // Proprietary product; unlicensed use is not allowed package strains // 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" "code.tnxs.net/taxnexus/lib/api/metrc-gw/metrc_gw_models" ) // DeleteStrainReader is a Reader for the DeleteStrain structure. type DeleteStrainReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *DeleteStrainReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewDeleteStrainOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewDeleteStrainUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewDeleteStrainForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewDeleteStrainNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewDeleteStrainInternalServerError() 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()) } } // NewDeleteStrainOK creates a DeleteStrainOK with default headers values func NewDeleteStrainOK() *DeleteStrainOK { return &DeleteStrainOK{} } /*DeleteStrainOK handles this case with default header values. Strains were successfully retrieved */ type DeleteStrainOK struct { Payload *metrc_gw_models.StrainResponse } func (o *DeleteStrainOK) Error() string { return fmt.Sprintf("[DELETE /strains][%d] deleteStrainOK %+v", 200, o.Payload) } func (o *DeleteStrainOK) GetPayload() *metrc_gw_models.StrainResponse { return o.Payload } func (o *DeleteStrainOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(metrc_gw_models.StrainResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewDeleteStrainUnauthorized creates a DeleteStrainUnauthorized with default headers values func NewDeleteStrainUnauthorized() *DeleteStrainUnauthorized { return &DeleteStrainUnauthorized{} } /*DeleteStrainUnauthorized handles this case with default header values. Access unauthorized, invalid API-KEY was used */ type DeleteStrainUnauthorized struct { Payload *metrc_gw_models.Error } func (o *DeleteStrainUnauthorized) Error() string { return fmt.Sprintf("[DELETE /strains][%d] deleteStrainUnauthorized %+v", 401, o.Payload) } func (o *DeleteStrainUnauthorized) GetPayload() *metrc_gw_models.Error { return o.Payload } func (o *DeleteStrainUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(metrc_gw_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewDeleteStrainForbidden creates a DeleteStrainForbidden with default headers values func NewDeleteStrainForbidden() *DeleteStrainForbidden { return &DeleteStrainForbidden{} } /*DeleteStrainForbidden handles this case with default header values. Access forbidden, account lacks access */ type DeleteStrainForbidden struct { Payload *metrc_gw_models.Error } func (o *DeleteStrainForbidden) Error() string { return fmt.Sprintf("[DELETE /strains][%d] deleteStrainForbidden %+v", 403, o.Payload) } func (o *DeleteStrainForbidden) GetPayload() *metrc_gw_models.Error { return o.Payload } func (o *DeleteStrainForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(metrc_gw_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewDeleteStrainNotFound creates a DeleteStrainNotFound with default headers values func NewDeleteStrainNotFound() *DeleteStrainNotFound { return &DeleteStrainNotFound{} } /*DeleteStrainNotFound handles this case with default header values. Resource was not found */ type DeleteStrainNotFound struct { Payload *metrc_gw_models.Error } func (o *DeleteStrainNotFound) Error() string { return fmt.Sprintf("[DELETE /strains][%d] deleteStrainNotFound %+v", 404, o.Payload) } func (o *DeleteStrainNotFound) GetPayload() *metrc_gw_models.Error { return o.Payload } func (o *DeleteStrainNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(metrc_gw_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewDeleteStrainInternalServerError creates a DeleteStrainInternalServerError with default headers values func NewDeleteStrainInternalServerError() *DeleteStrainInternalServerError { return &DeleteStrainInternalServerError{} } /*DeleteStrainInternalServerError handles this case with default header values. Server Internal Error */ type DeleteStrainInternalServerError struct { Payload *metrc_gw_models.Error } func (o *DeleteStrainInternalServerError) Error() string { return fmt.Sprintf("[DELETE /strains][%d] deleteStrainInternalServerError %+v", 500, o.Payload) } func (o *DeleteStrainInternalServerError) GetPayload() *metrc_gw_models.Error { return o.Payload } func (o *DeleteStrainInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(metrc_gw_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }