// 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 observations // 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/vernonkeenan/lib/api/sfgate/sfgate_models" ) // GetObservationsReader is a Reader for the GetObservations structure. type GetObservationsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetObservationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetObservationsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetObservationsUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetObservationsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetObservationsNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetObservationsUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetObservationsInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } // NewGetObservationsOK creates a GetObservationsOK with default headers values func NewGetObservationsOK() *GetObservationsOK { return &GetObservationsOK{} } /* GetObservationsOK describes a response with status code 200, with default header values. Response with Observation objects */ type GetObservationsOK struct { Payload *sfgate_models.ObservationResponse } // IsSuccess returns true when this get observations o k response has a 2xx status code func (o *GetObservationsOK) IsSuccess() bool { return true } // IsRedirect returns true when this get observations o k response has a 3xx status code func (o *GetObservationsOK) IsRedirect() bool { return false } // IsClientError returns true when this get observations o k response has a 4xx status code func (o *GetObservationsOK) IsClientError() bool { return false } // IsServerError returns true when this get observations o k response has a 5xx status code func (o *GetObservationsOK) IsServerError() bool { return false } // IsCode returns true when this get observations o k response a status code equal to that given func (o *GetObservationsOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the get observations o k response func (o *GetObservationsOK) Code() int { return 200 } func (o *GetObservationsOK) Error() string { return fmt.Sprintf("[GET /observations][%d] getObservationsOK %+v", 200, o.Payload) } func (o *GetObservationsOK) String() string { return fmt.Sprintf("[GET /observations][%d] getObservationsOK %+v", 200, o.Payload) } func (o *GetObservationsOK) GetPayload() *sfgate_models.ObservationResponse { return o.Payload } func (o *GetObservationsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.ObservationResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetObservationsUnauthorized creates a GetObservationsUnauthorized with default headers values func NewGetObservationsUnauthorized() *GetObservationsUnauthorized { return &GetObservationsUnauthorized{} } /* GetObservationsUnauthorized describes a response with status code 401, with default header values. Access unauthorized, invalid API-KEY was used */ type GetObservationsUnauthorized struct { AccessControlAllowOrigin string Payload *sfgate_models.Error } // IsSuccess returns true when this get observations unauthorized response has a 2xx status code func (o *GetObservationsUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this get observations unauthorized response has a 3xx status code func (o *GetObservationsUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this get observations unauthorized response has a 4xx status code func (o *GetObservationsUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this get observations unauthorized response has a 5xx status code func (o *GetObservationsUnauthorized) IsServerError() bool { return false } // IsCode returns true when this get observations unauthorized response a status code equal to that given func (o *GetObservationsUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the get observations unauthorized response func (o *GetObservationsUnauthorized) Code() int { return 401 } func (o *GetObservationsUnauthorized) Error() string { return fmt.Sprintf("[GET /observations][%d] getObservationsUnauthorized %+v", 401, o.Payload) } func (o *GetObservationsUnauthorized) String() string { return fmt.Sprintf("[GET /observations][%d] getObservationsUnauthorized %+v", 401, o.Payload) } func (o *GetObservationsUnauthorized) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetObservationsUnauthorized) 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(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetObservationsForbidden creates a GetObservationsForbidden with default headers values func NewGetObservationsForbidden() *GetObservationsForbidden { return &GetObservationsForbidden{} } /* GetObservationsForbidden describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type GetObservationsForbidden struct { AccessControlAllowOrigin string Payload *sfgate_models.Error } // IsSuccess returns true when this get observations forbidden response has a 2xx status code func (o *GetObservationsForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this get observations forbidden response has a 3xx status code func (o *GetObservationsForbidden) IsRedirect() bool { return false } // IsClientError returns true when this get observations forbidden response has a 4xx status code func (o *GetObservationsForbidden) IsClientError() bool { return true } // IsServerError returns true when this get observations forbidden response has a 5xx status code func (o *GetObservationsForbidden) IsServerError() bool { return false } // IsCode returns true when this get observations forbidden response a status code equal to that given func (o *GetObservationsForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the get observations forbidden response func (o *GetObservationsForbidden) Code() int { return 403 } func (o *GetObservationsForbidden) Error() string { return fmt.Sprintf("[GET /observations][%d] getObservationsForbidden %+v", 403, o.Payload) } func (o *GetObservationsForbidden) String() string { return fmt.Sprintf("[GET /observations][%d] getObservationsForbidden %+v", 403, o.Payload) } func (o *GetObservationsForbidden) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetObservationsForbidden) 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(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetObservationsNotFound creates a GetObservationsNotFound with default headers values func NewGetObservationsNotFound() *GetObservationsNotFound { return &GetObservationsNotFound{} } /* GetObservationsNotFound describes a response with status code 404, with default header values. Resource was not found */ type GetObservationsNotFound struct { AccessControlAllowOrigin string Payload *sfgate_models.Error } // IsSuccess returns true when this get observations not found response has a 2xx status code func (o *GetObservationsNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this get observations not found response has a 3xx status code func (o *GetObservationsNotFound) IsRedirect() bool { return false } // IsClientError returns true when this get observations not found response has a 4xx status code func (o *GetObservationsNotFound) IsClientError() bool { return true } // IsServerError returns true when this get observations not found response has a 5xx status code func (o *GetObservationsNotFound) IsServerError() bool { return false } // IsCode returns true when this get observations not found response a status code equal to that given func (o *GetObservationsNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the get observations not found response func (o *GetObservationsNotFound) Code() int { return 404 } func (o *GetObservationsNotFound) Error() string { return fmt.Sprintf("[GET /observations][%d] getObservationsNotFound %+v", 404, o.Payload) } func (o *GetObservationsNotFound) String() string { return fmt.Sprintf("[GET /observations][%d] getObservationsNotFound %+v", 404, o.Payload) } func (o *GetObservationsNotFound) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetObservationsNotFound) 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(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetObservationsUnprocessableEntity creates a GetObservationsUnprocessableEntity with default headers values func NewGetObservationsUnprocessableEntity() *GetObservationsUnprocessableEntity { return &GetObservationsUnprocessableEntity{} } /* GetObservationsUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity, likely a bad parameter */ type GetObservationsUnprocessableEntity struct { AccessControlAllowOrigin string Payload *sfgate_models.Error } // IsSuccess returns true when this get observations unprocessable entity response has a 2xx status code func (o *GetObservationsUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this get observations unprocessable entity response has a 3xx status code func (o *GetObservationsUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this get observations unprocessable entity response has a 4xx status code func (o *GetObservationsUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this get observations unprocessable entity response has a 5xx status code func (o *GetObservationsUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this get observations unprocessable entity response a status code equal to that given func (o *GetObservationsUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the get observations unprocessable entity response func (o *GetObservationsUnprocessableEntity) Code() int { return 422 } func (o *GetObservationsUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /observations][%d] getObservationsUnprocessableEntity %+v", 422, o.Payload) } func (o *GetObservationsUnprocessableEntity) String() string { return fmt.Sprintf("[GET /observations][%d] getObservationsUnprocessableEntity %+v", 422, o.Payload) } func (o *GetObservationsUnprocessableEntity) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetObservationsUnprocessableEntity) 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(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetObservationsInternalServerError creates a GetObservationsInternalServerError with default headers values func NewGetObservationsInternalServerError() *GetObservationsInternalServerError { return &GetObservationsInternalServerError{} } /* GetObservationsInternalServerError describes a response with status code 500, with default header values. Server Internal Error */ type GetObservationsInternalServerError struct { AccessControlAllowOrigin string Payload *sfgate_models.Error } // IsSuccess returns true when this get observations internal server error response has a 2xx status code func (o *GetObservationsInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this get observations internal server error response has a 3xx status code func (o *GetObservationsInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this get observations internal server error response has a 4xx status code func (o *GetObservationsInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this get observations internal server error response has a 5xx status code func (o *GetObservationsInternalServerError) IsServerError() bool { return true } // IsCode returns true when this get observations internal server error response a status code equal to that given func (o *GetObservationsInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the get observations internal server error response func (o *GetObservationsInternalServerError) Code() int { return 500 } func (o *GetObservationsInternalServerError) Error() string { return fmt.Sprintf("[GET /observations][%d] getObservationsInternalServerError %+v", 500, o.Payload) } func (o *GetObservationsInternalServerError) String() string { return fmt.Sprintf("[GET /observations][%d] getObservationsInternalServerError %+v", 500, o.Payload) } func (o *GetObservationsInternalServerError) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetObservationsInternalServerError) 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(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }