// 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 topics // 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" ) // GetTopicsReader is a Reader for the GetTopics structure. type GetTopicsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetTopicsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetTopicsUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetTopicsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetTopicsNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetTopicsUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetTopicsInternalServerError() 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()) } } // NewGetTopicsOK creates a GetTopicsOK with default headers values func NewGetTopicsOK() *GetTopicsOK { return &GetTopicsOK{} } /* GetTopicsOK describes a response with status code 200, with default header values. Response with Topic objects */ type GetTopicsOK struct { Payload *sfgate_models.TopicResponse } // IsSuccess returns true when this get topics o k response has a 2xx status code func (o *GetTopicsOK) IsSuccess() bool { return true } // IsRedirect returns true when this get topics o k response has a 3xx status code func (o *GetTopicsOK) IsRedirect() bool { return false } // IsClientError returns true when this get topics o k response has a 4xx status code func (o *GetTopicsOK) IsClientError() bool { return false } // IsServerError returns true when this get topics o k response has a 5xx status code func (o *GetTopicsOK) IsServerError() bool { return false } // IsCode returns true when this get topics o k response a status code equal to that given func (o *GetTopicsOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the get topics o k response func (o *GetTopicsOK) Code() int { return 200 } func (o *GetTopicsOK) Error() string { return fmt.Sprintf("[GET /topics][%d] getTopicsOK %+v", 200, o.Payload) } func (o *GetTopicsOK) String() string { return fmt.Sprintf("[GET /topics][%d] getTopicsOK %+v", 200, o.Payload) } func (o *GetTopicsOK) GetPayload() *sfgate_models.TopicResponse { return o.Payload } func (o *GetTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.TopicResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetTopicsUnauthorized creates a GetTopicsUnauthorized with default headers values func NewGetTopicsUnauthorized() *GetTopicsUnauthorized { return &GetTopicsUnauthorized{} } /* GetTopicsUnauthorized describes a response with status code 401, with default header values. Access unauthorized, invalid API-KEY was used */ type GetTopicsUnauthorized struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get topics unauthorized response has a 2xx status code func (o *GetTopicsUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this get topics unauthorized response has a 3xx status code func (o *GetTopicsUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this get topics unauthorized response has a 4xx status code func (o *GetTopicsUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this get topics unauthorized response has a 5xx status code func (o *GetTopicsUnauthorized) IsServerError() bool { return false } // IsCode returns true when this get topics unauthorized response a status code equal to that given func (o *GetTopicsUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the get topics unauthorized response func (o *GetTopicsUnauthorized) Code() int { return 401 } func (o *GetTopicsUnauthorized) Error() string { return fmt.Sprintf("[GET /topics][%d] getTopicsUnauthorized %+v", 401, o.Payload) } func (o *GetTopicsUnauthorized) String() string { return fmt.Sprintf("[GET /topics][%d] getTopicsUnauthorized %+v", 401, o.Payload) } func (o *GetTopicsUnauthorized) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetTopicsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 } // NewGetTopicsForbidden creates a GetTopicsForbidden with default headers values func NewGetTopicsForbidden() *GetTopicsForbidden { return &GetTopicsForbidden{} } /* GetTopicsForbidden describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type GetTopicsForbidden struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get topics forbidden response has a 2xx status code func (o *GetTopicsForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this get topics forbidden response has a 3xx status code func (o *GetTopicsForbidden) IsRedirect() bool { return false } // IsClientError returns true when this get topics forbidden response has a 4xx status code func (o *GetTopicsForbidden) IsClientError() bool { return true } // IsServerError returns true when this get topics forbidden response has a 5xx status code func (o *GetTopicsForbidden) IsServerError() bool { return false } // IsCode returns true when this get topics forbidden response a status code equal to that given func (o *GetTopicsForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the get topics forbidden response func (o *GetTopicsForbidden) Code() int { return 403 } func (o *GetTopicsForbidden) Error() string { return fmt.Sprintf("[GET /topics][%d] getTopicsForbidden %+v", 403, o.Payload) } func (o *GetTopicsForbidden) String() string { return fmt.Sprintf("[GET /topics][%d] getTopicsForbidden %+v", 403, o.Payload) } func (o *GetTopicsForbidden) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetTopicsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 } // NewGetTopicsNotFound creates a GetTopicsNotFound with default headers values func NewGetTopicsNotFound() *GetTopicsNotFound { return &GetTopicsNotFound{} } /* GetTopicsNotFound describes a response with status code 404, with default header values. Resource was not found */ type GetTopicsNotFound struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get topics not found response has a 2xx status code func (o *GetTopicsNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this get topics not found response has a 3xx status code func (o *GetTopicsNotFound) IsRedirect() bool { return false } // IsClientError returns true when this get topics not found response has a 4xx status code func (o *GetTopicsNotFound) IsClientError() bool { return true } // IsServerError returns true when this get topics not found response has a 5xx status code func (o *GetTopicsNotFound) IsServerError() bool { return false } // IsCode returns true when this get topics not found response a status code equal to that given func (o *GetTopicsNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the get topics not found response func (o *GetTopicsNotFound) Code() int { return 404 } func (o *GetTopicsNotFound) Error() string { return fmt.Sprintf("[GET /topics][%d] getTopicsNotFound %+v", 404, o.Payload) } func (o *GetTopicsNotFound) String() string { return fmt.Sprintf("[GET /topics][%d] getTopicsNotFound %+v", 404, o.Payload) } func (o *GetTopicsNotFound) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetTopicsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 } // NewGetTopicsUnprocessableEntity creates a GetTopicsUnprocessableEntity with default headers values func NewGetTopicsUnprocessableEntity() *GetTopicsUnprocessableEntity { return &GetTopicsUnprocessableEntity{} } /* GetTopicsUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity, likely a bad parameter */ type GetTopicsUnprocessableEntity struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get topics unprocessable entity response has a 2xx status code func (o *GetTopicsUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this get topics unprocessable entity response has a 3xx status code func (o *GetTopicsUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this get topics unprocessable entity response has a 4xx status code func (o *GetTopicsUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this get topics unprocessable entity response has a 5xx status code func (o *GetTopicsUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this get topics unprocessable entity response a status code equal to that given func (o *GetTopicsUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the get topics unprocessable entity response func (o *GetTopicsUnprocessableEntity) Code() int { return 422 } func (o *GetTopicsUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /topics][%d] getTopicsUnprocessableEntity %+v", 422, o.Payload) } func (o *GetTopicsUnprocessableEntity) String() string { return fmt.Sprintf("[GET /topics][%d] getTopicsUnprocessableEntity %+v", 422, o.Payload) } func (o *GetTopicsUnprocessableEntity) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetTopicsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 } // NewGetTopicsInternalServerError creates a GetTopicsInternalServerError with default headers values func NewGetTopicsInternalServerError() *GetTopicsInternalServerError { return &GetTopicsInternalServerError{} } /* GetTopicsInternalServerError describes a response with status code 500, with default header values. Server Internal Error */ type GetTopicsInternalServerError struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get topics internal server error response has a 2xx status code func (o *GetTopicsInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this get topics internal server error response has a 3xx status code func (o *GetTopicsInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this get topics internal server error response has a 4xx status code func (o *GetTopicsInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this get topics internal server error response has a 5xx status code func (o *GetTopicsInternalServerError) IsServerError() bool { return true } // IsCode returns true when this get topics internal server error response a status code equal to that given func (o *GetTopicsInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the get topics internal server error response func (o *GetTopicsInternalServerError) Code() int { return 500 } func (o *GetTopicsInternalServerError) Error() string { return fmt.Sprintf("[GET /topics][%d] getTopicsInternalServerError %+v", 500, o.Payload) } func (o *GetTopicsInternalServerError) String() string { return fmt.Sprintf("[GET /topics][%d] getTopicsInternalServerError %+v", 500, o.Payload) } func (o *GetTopicsInternalServerError) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetTopicsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 }