// 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 quotes // 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/sf-gate/sf_gate_models" ) // GetQuotesReader is a Reader for the GetQuotes structure. type GetQuotesReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetQuotesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetQuotesOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetQuotesUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetQuotesForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetQuotesNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetQuotesUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetQuotesInternalServerError() 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()) } } // NewGetQuotesOK creates a GetQuotesOK with default headers values func NewGetQuotesOK() *GetQuotesOK { return &GetQuotesOK{} } /*GetQuotesOK handles this case with default header values. An array of Quote objects */ type GetQuotesOK struct { Payload *sf_gate_models.QuoteResponse } func (o *GetQuotesOK) Error() string { return fmt.Sprintf("[GET /quotes][%d] getQuotesOK %+v", 200, o.Payload) } func (o *GetQuotesOK) GetPayload() *sf_gate_models.QuoteResponse { return o.Payload } func (o *GetQuotesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.QuoteResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetQuotesUnauthorized creates a GetQuotesUnauthorized with default headers values func NewGetQuotesUnauthorized() *GetQuotesUnauthorized { return &GetQuotesUnauthorized{} } /*GetQuotesUnauthorized handles this case with default header values. Access unauthorized, invalid API-KEY was used */ type GetQuotesUnauthorized struct { Payload *sf_gate_models.Error } func (o *GetQuotesUnauthorized) Error() string { return fmt.Sprintf("[GET /quotes][%d] getQuotesUnauthorized %+v", 401, o.Payload) } func (o *GetQuotesUnauthorized) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetQuotesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetQuotesForbidden creates a GetQuotesForbidden with default headers values func NewGetQuotesForbidden() *GetQuotesForbidden { return &GetQuotesForbidden{} } /*GetQuotesForbidden handles this case with default header values. Access forbidden, account lacks access */ type GetQuotesForbidden struct { Payload *sf_gate_models.Error } func (o *GetQuotesForbidden) Error() string { return fmt.Sprintf("[GET /quotes][%d] getQuotesForbidden %+v", 403, o.Payload) } func (o *GetQuotesForbidden) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetQuotesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetQuotesNotFound creates a GetQuotesNotFound with default headers values func NewGetQuotesNotFound() *GetQuotesNotFound { return &GetQuotesNotFound{} } /*GetQuotesNotFound handles this case with default header values. Resource was not found */ type GetQuotesNotFound struct { Payload *sf_gate_models.Error } func (o *GetQuotesNotFound) Error() string { return fmt.Sprintf("[GET /quotes][%d] getQuotesNotFound %+v", 404, o.Payload) } func (o *GetQuotesNotFound) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetQuotesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetQuotesUnprocessableEntity creates a GetQuotesUnprocessableEntity with default headers values func NewGetQuotesUnprocessableEntity() *GetQuotesUnprocessableEntity { return &GetQuotesUnprocessableEntity{} } /*GetQuotesUnprocessableEntity handles this case with default header values. Unprocessable Entity, likely a bad parameter */ type GetQuotesUnprocessableEntity struct { Payload *sf_gate_models.Error } func (o *GetQuotesUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /quotes][%d] getQuotesUnprocessableEntity %+v", 422, o.Payload) } func (o *GetQuotesUnprocessableEntity) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetQuotesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetQuotesInternalServerError creates a GetQuotesInternalServerError with default headers values func NewGetQuotesInternalServerError() *GetQuotesInternalServerError { return &GetQuotesInternalServerError{} } /*GetQuotesInternalServerError handles this case with default header values. Server Internal Error */ type GetQuotesInternalServerError struct { Payload *sf_gate_models.Error } func (o *GetQuotesInternalServerError) Error() string { return fmt.Sprintf("[GET /quotes][%d] getQuotesInternalServerError %+v", 500, o.Payload) } func (o *GetQuotesInternalServerError) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetQuotesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }