// 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 counties // 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/taxnexus/go/lib/api/sf-gate/sf_gate_models" ) // GetCountiesReader is a Reader for the GetCounties structure. type GetCountiesReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetCountiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetCountiesOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetCountiesUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetCountiesForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetCountiesNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetCountiesUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetCountiesInternalServerError() 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()) } } // NewGetCountiesOK creates a GetCountiesOK with default headers values func NewGetCountiesOK() *GetCountiesOK { return &GetCountiesOK{} } /*GetCountiesOK handles this case with default header values. Taxnexus Response with an array of County objects */ type GetCountiesOK struct { Payload *sf_gate_models.CountyResponse } func (o *GetCountiesOK) Error() string { return fmt.Sprintf("[GET /counties][%d] getCountiesOK %+v", 200, o.Payload) } func (o *GetCountiesOK) GetPayload() *sf_gate_models.CountyResponse { return o.Payload } func (o *GetCountiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sf_gate_models.CountyResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetCountiesUnauthorized creates a GetCountiesUnauthorized with default headers values func NewGetCountiesUnauthorized() *GetCountiesUnauthorized { return &GetCountiesUnauthorized{} } /*GetCountiesUnauthorized handles this case with default header values. Access unauthorized, invalid API-KEY was used */ type GetCountiesUnauthorized struct { Payload *sf_gate_models.Error } func (o *GetCountiesUnauthorized) Error() string { return fmt.Sprintf("[GET /counties][%d] getCountiesUnauthorized %+v", 401, o.Payload) } func (o *GetCountiesUnauthorized) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetCountiesUnauthorized) 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 } // NewGetCountiesForbidden creates a GetCountiesForbidden with default headers values func NewGetCountiesForbidden() *GetCountiesForbidden { return &GetCountiesForbidden{} } /*GetCountiesForbidden handles this case with default header values. Access forbidden, account lacks access */ type GetCountiesForbidden struct { Payload *sf_gate_models.Error } func (o *GetCountiesForbidden) Error() string { return fmt.Sprintf("[GET /counties][%d] getCountiesForbidden %+v", 403, o.Payload) } func (o *GetCountiesForbidden) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetCountiesForbidden) 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 } // NewGetCountiesNotFound creates a GetCountiesNotFound with default headers values func NewGetCountiesNotFound() *GetCountiesNotFound { return &GetCountiesNotFound{} } /*GetCountiesNotFound handles this case with default header values. Resource was not found */ type GetCountiesNotFound struct { Payload *sf_gate_models.Error } func (o *GetCountiesNotFound) Error() string { return fmt.Sprintf("[GET /counties][%d] getCountiesNotFound %+v", 404, o.Payload) } func (o *GetCountiesNotFound) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetCountiesNotFound) 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 } // NewGetCountiesUnprocessableEntity creates a GetCountiesUnprocessableEntity with default headers values func NewGetCountiesUnprocessableEntity() *GetCountiesUnprocessableEntity { return &GetCountiesUnprocessableEntity{} } /*GetCountiesUnprocessableEntity handles this case with default header values. Unprocessable Entity, likely a bad parameter */ type GetCountiesUnprocessableEntity struct { Payload *sf_gate_models.Error } func (o *GetCountiesUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /counties][%d] getCountiesUnprocessableEntity %+v", 422, o.Payload) } func (o *GetCountiesUnprocessableEntity) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetCountiesUnprocessableEntity) 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 } // NewGetCountiesInternalServerError creates a GetCountiesInternalServerError with default headers values func NewGetCountiesInternalServerError() *GetCountiesInternalServerError { return &GetCountiesInternalServerError{} } /*GetCountiesInternalServerError handles this case with default header values. Server Internal Error */ type GetCountiesInternalServerError struct { Payload *sf_gate_models.Error } func (o *GetCountiesInternalServerError) Error() string { return fmt.Sprintf("[GET /counties][%d] getCountiesInternalServerError %+v", 500, o.Payload) } func (o *GetCountiesInternalServerError) GetPayload() *sf_gate_models.Error { return o.Payload } func (o *GetCountiesInternalServerError) 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 }