// 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 template // 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/devops/devops_models" ) // GetTemplatesReader is a Reader for the GetTemplates structure. type GetTemplatesReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetTemplatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewGetTemplatesOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetTemplatesUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetTemplatesForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetTemplatesNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetTemplatesUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetTemplatesInternalServerError() 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()) } } // NewGetTemplatesOK creates a GetTemplatesOK with default headers values func NewGetTemplatesOK() *GetTemplatesOK { return &GetTemplatesOK{} } /* GetTemplatesOK describes a response with status code 200, with default header values. Taxnexus Response with Template objects */ type GetTemplatesOK struct { AccessControlAllowOrigin string CacheControl string Payload *devops_models.TemplateResponse } // IsSuccess returns true when this get templates o k response has a 2xx status code func (o *GetTemplatesOK) IsSuccess() bool { return true } // IsRedirect returns true when this get templates o k response has a 3xx status code func (o *GetTemplatesOK) IsRedirect() bool { return false } // IsClientError returns true when this get templates o k response has a 4xx status code func (o *GetTemplatesOK) IsClientError() bool { return false } // IsServerError returns true when this get templates o k response has a 5xx status code func (o *GetTemplatesOK) IsServerError() bool { return false } // IsCode returns true when this get templates o k response a status code equal to that given func (o *GetTemplatesOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the get templates o k response func (o *GetTemplatesOK) Code() int { return 200 } func (o *GetTemplatesOK) Error() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %+v", 200, o.Payload) } func (o *GetTemplatesOK) String() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesOK %+v", 200, o.Payload) } func (o *GetTemplatesOK) GetPayload() *devops_models.TemplateResponse { return o.Payload } func (o *GetTemplatesOK) 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 } // hydrates response header Cache-Control hdrCacheControl := response.GetHeader("Cache-Control") if hdrCacheControl != "" { o.CacheControl = hdrCacheControl } o.Payload = new(devops_models.TemplateResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetTemplatesUnauthorized creates a GetTemplatesUnauthorized with default headers values func NewGetTemplatesUnauthorized() *GetTemplatesUnauthorized { return &GetTemplatesUnauthorized{} } /* GetTemplatesUnauthorized describes a response with status code 401, with default header values. Access Unauthorized, invalid API-KEY was used */ type GetTemplatesUnauthorized struct { AccessControlAllowOrigin string CacheControl string Payload *devops_models.Error } // IsSuccess returns true when this get templates unauthorized response has a 2xx status code func (o *GetTemplatesUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this get templates unauthorized response has a 3xx status code func (o *GetTemplatesUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this get templates unauthorized response has a 4xx status code func (o *GetTemplatesUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this get templates unauthorized response has a 5xx status code func (o *GetTemplatesUnauthorized) IsServerError() bool { return false } // IsCode returns true when this get templates unauthorized response a status code equal to that given func (o *GetTemplatesUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the get templates unauthorized response func (o *GetTemplatesUnauthorized) Code() int { return 401 } func (o *GetTemplatesUnauthorized) Error() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %+v", 401, o.Payload) } func (o *GetTemplatesUnauthorized) String() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesUnauthorized %+v", 401, o.Payload) } func (o *GetTemplatesUnauthorized) GetPayload() *devops_models.Error { return o.Payload } func (o *GetTemplatesUnauthorized) 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 } // hydrates response header Cache-Control hdrCacheControl := response.GetHeader("Cache-Control") if hdrCacheControl != "" { o.CacheControl = hdrCacheControl } o.Payload = new(devops_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetTemplatesForbidden creates a GetTemplatesForbidden with default headers values func NewGetTemplatesForbidden() *GetTemplatesForbidden { return &GetTemplatesForbidden{} } /* GetTemplatesForbidden describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type GetTemplatesForbidden struct { AccessControlAllowOrigin string Payload *devops_models.Error } // IsSuccess returns true when this get templates forbidden response has a 2xx status code func (o *GetTemplatesForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this get templates forbidden response has a 3xx status code func (o *GetTemplatesForbidden) IsRedirect() bool { return false } // IsClientError returns true when this get templates forbidden response has a 4xx status code func (o *GetTemplatesForbidden) IsClientError() bool { return true } // IsServerError returns true when this get templates forbidden response has a 5xx status code func (o *GetTemplatesForbidden) IsServerError() bool { return false } // IsCode returns true when this get templates forbidden response a status code equal to that given func (o *GetTemplatesForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the get templates forbidden response func (o *GetTemplatesForbidden) Code() int { return 403 } func (o *GetTemplatesForbidden) Error() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %+v", 403, o.Payload) } func (o *GetTemplatesForbidden) String() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesForbidden %+v", 403, o.Payload) } func (o *GetTemplatesForbidden) GetPayload() *devops_models.Error { return o.Payload } func (o *GetTemplatesForbidden) 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(devops_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetTemplatesNotFound creates a GetTemplatesNotFound with default headers values func NewGetTemplatesNotFound() *GetTemplatesNotFound { return &GetTemplatesNotFound{} } /* GetTemplatesNotFound describes a response with status code 404, with default header values. Resource was not found */ type GetTemplatesNotFound struct { AccessControlAllowOrigin string Payload *devops_models.Error } // IsSuccess returns true when this get templates not found response has a 2xx status code func (o *GetTemplatesNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this get templates not found response has a 3xx status code func (o *GetTemplatesNotFound) IsRedirect() bool { return false } // IsClientError returns true when this get templates not found response has a 4xx status code func (o *GetTemplatesNotFound) IsClientError() bool { return true } // IsServerError returns true when this get templates not found response has a 5xx status code func (o *GetTemplatesNotFound) IsServerError() bool { return false } // IsCode returns true when this get templates not found response a status code equal to that given func (o *GetTemplatesNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the get templates not found response func (o *GetTemplatesNotFound) Code() int { return 404 } func (o *GetTemplatesNotFound) Error() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %+v", 404, o.Payload) } func (o *GetTemplatesNotFound) String() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesNotFound %+v", 404, o.Payload) } func (o *GetTemplatesNotFound) GetPayload() *devops_models.Error { return o.Payload } func (o *GetTemplatesNotFound) 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(devops_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetTemplatesUnprocessableEntity creates a GetTemplatesUnprocessableEntity with default headers values func NewGetTemplatesUnprocessableEntity() *GetTemplatesUnprocessableEntity { return &GetTemplatesUnprocessableEntity{} } /* GetTemplatesUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity, likely a bad parameter */ type GetTemplatesUnprocessableEntity struct { AccessControlAllowOrigin string CacheControl string Payload *devops_models.Error } // IsSuccess returns true when this get templates unprocessable entity response has a 2xx status code func (o *GetTemplatesUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this get templates unprocessable entity response has a 3xx status code func (o *GetTemplatesUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this get templates unprocessable entity response has a 4xx status code func (o *GetTemplatesUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this get templates unprocessable entity response has a 5xx status code func (o *GetTemplatesUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this get templates unprocessable entity response a status code equal to that given func (o *GetTemplatesUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the get templates unprocessable entity response func (o *GetTemplatesUnprocessableEntity) Code() int { return 422 } func (o *GetTemplatesUnprocessableEntity) Error() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %+v", 422, o.Payload) } func (o *GetTemplatesUnprocessableEntity) String() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesUnprocessableEntity %+v", 422, o.Payload) } func (o *GetTemplatesUnprocessableEntity) GetPayload() *devops_models.Error { return o.Payload } func (o *GetTemplatesUnprocessableEntity) 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 } // hydrates response header Cache-Control hdrCacheControl := response.GetHeader("Cache-Control") if hdrCacheControl != "" { o.CacheControl = hdrCacheControl } o.Payload = new(devops_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewGetTemplatesInternalServerError creates a GetTemplatesInternalServerError with default headers values func NewGetTemplatesInternalServerError() *GetTemplatesInternalServerError { return &GetTemplatesInternalServerError{} } /* GetTemplatesInternalServerError describes a response with status code 500, with default header values. Server Internal Error */ type GetTemplatesInternalServerError struct { AccessControlAllowOrigin string Payload *devops_models.Error } // IsSuccess returns true when this get templates internal server error response has a 2xx status code func (o *GetTemplatesInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this get templates internal server error response has a 3xx status code func (o *GetTemplatesInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this get templates internal server error response has a 4xx status code func (o *GetTemplatesInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this get templates internal server error response has a 5xx status code func (o *GetTemplatesInternalServerError) IsServerError() bool { return true } // IsCode returns true when this get templates internal server error response a status code equal to that given func (o *GetTemplatesInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the get templates internal server error response func (o *GetTemplatesInternalServerError) Code() int { return 500 } func (o *GetTemplatesInternalServerError) Error() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %+v", 500, o.Payload) } func (o *GetTemplatesInternalServerError) String() string { return fmt.Sprintf("[GET /templates][%d] getTemplatesInternalServerError %+v", 500, o.Payload) } func (o *GetTemplatesInternalServerError) GetPayload() *devops_models.Error { return o.Payload } func (o *GetTemplatesInternalServerError) 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(devops_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }