// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package company_services

// 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/work/lib/api/sfgate/sfgate_models"
)

// GetCompanyServicesReader is a Reader for the GetCompanyServices structure.
type GetCompanyServicesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetCompanyServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetCompanyServicesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetCompanyServicesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetCompanyServicesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetCompanyServicesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetCompanyServicesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetCompanyServicesInternalServerError()
		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())
	}
}

// NewGetCompanyServicesOK creates a GetCompanyServicesOK with default headers values
func NewGetCompanyServicesOK() *GetCompanyServicesOK {
	return &GetCompanyServicesOK{}
}

/*
GetCompanyServicesOK describes a response with status code 200, with default header values.

Response with CompanyService objects
*/
type GetCompanyServicesOK struct {
	Payload *sfgate_models.CompanyServiceResponse
}

// IsSuccess returns true when this get company services o k response has a 2xx status code
func (o *GetCompanyServicesOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get company services o k response has a 3xx status code
func (o *GetCompanyServicesOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company services o k response has a 4xx status code
func (o *GetCompanyServicesOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get company services o k response has a 5xx status code
func (o *GetCompanyServicesOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get company services o k response a status code equal to that given
func (o *GetCompanyServicesOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get company services o k response
func (o *GetCompanyServicesOK) Code() int {
	return 200
}

func (o *GetCompanyServicesOK) Error() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesOK  %+v", 200, o.Payload)
}

func (o *GetCompanyServicesOK) String() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesOK  %+v", 200, o.Payload)
}

func (o *GetCompanyServicesOK) GetPayload() *sfgate_models.CompanyServiceResponse {
	return o.Payload
}

func (o *GetCompanyServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sfgate_models.CompanyServiceResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetCompanyServicesUnauthorized creates a GetCompanyServicesUnauthorized with default headers values
func NewGetCompanyServicesUnauthorized() *GetCompanyServicesUnauthorized {
	return &GetCompanyServicesUnauthorized{}
}

/*
GetCompanyServicesUnauthorized describes a response with status code 401, with default header values.

Access unauthorized, invalid API-KEY was used
*/
type GetCompanyServicesUnauthorized struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company services unauthorized response has a 2xx status code
func (o *GetCompanyServicesUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company services unauthorized response has a 3xx status code
func (o *GetCompanyServicesUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company services unauthorized response has a 4xx status code
func (o *GetCompanyServicesUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company services unauthorized response has a 5xx status code
func (o *GetCompanyServicesUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get company services unauthorized response a status code equal to that given
func (o *GetCompanyServicesUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get company services unauthorized response
func (o *GetCompanyServicesUnauthorized) Code() int {
	return 401
}

func (o *GetCompanyServicesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetCompanyServicesUnauthorized) String() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetCompanyServicesUnauthorized) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetCompanyServicesUnauthorized) 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
}

// NewGetCompanyServicesForbidden creates a GetCompanyServicesForbidden with default headers values
func NewGetCompanyServicesForbidden() *GetCompanyServicesForbidden {
	return &GetCompanyServicesForbidden{}
}

/*
GetCompanyServicesForbidden describes a response with status code 403, with default header values.

Access forbidden, account lacks access
*/
type GetCompanyServicesForbidden struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company services forbidden response has a 2xx status code
func (o *GetCompanyServicesForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company services forbidden response has a 3xx status code
func (o *GetCompanyServicesForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company services forbidden response has a 4xx status code
func (o *GetCompanyServicesForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company services forbidden response has a 5xx status code
func (o *GetCompanyServicesForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get company services forbidden response a status code equal to that given
func (o *GetCompanyServicesForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get company services forbidden response
func (o *GetCompanyServicesForbidden) Code() int {
	return 403
}

func (o *GetCompanyServicesForbidden) Error() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesForbidden  %+v", 403, o.Payload)
}

func (o *GetCompanyServicesForbidden) String() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesForbidden  %+v", 403, o.Payload)
}

func (o *GetCompanyServicesForbidden) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetCompanyServicesForbidden) 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
}

// NewGetCompanyServicesNotFound creates a GetCompanyServicesNotFound with default headers values
func NewGetCompanyServicesNotFound() *GetCompanyServicesNotFound {
	return &GetCompanyServicesNotFound{}
}

/*
GetCompanyServicesNotFound describes a response with status code 404, with default header values.

Resource was not found
*/
type GetCompanyServicesNotFound struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company services not found response has a 2xx status code
func (o *GetCompanyServicesNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company services not found response has a 3xx status code
func (o *GetCompanyServicesNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company services not found response has a 4xx status code
func (o *GetCompanyServicesNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company services not found response has a 5xx status code
func (o *GetCompanyServicesNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get company services not found response a status code equal to that given
func (o *GetCompanyServicesNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get company services not found response
func (o *GetCompanyServicesNotFound) Code() int {
	return 404
}

func (o *GetCompanyServicesNotFound) Error() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesNotFound  %+v", 404, o.Payload)
}

func (o *GetCompanyServicesNotFound) String() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesNotFound  %+v", 404, o.Payload)
}

func (o *GetCompanyServicesNotFound) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetCompanyServicesNotFound) 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
}

// NewGetCompanyServicesUnprocessableEntity creates a GetCompanyServicesUnprocessableEntity with default headers values
func NewGetCompanyServicesUnprocessableEntity() *GetCompanyServicesUnprocessableEntity {
	return &GetCompanyServicesUnprocessableEntity{}
}

/*
GetCompanyServicesUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetCompanyServicesUnprocessableEntity struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company services unprocessable entity response has a 2xx status code
func (o *GetCompanyServicesUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company services unprocessable entity response has a 3xx status code
func (o *GetCompanyServicesUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company services unprocessable entity response has a 4xx status code
func (o *GetCompanyServicesUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this get company services unprocessable entity response has a 5xx status code
func (o *GetCompanyServicesUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this get company services unprocessable entity response a status code equal to that given
func (o *GetCompanyServicesUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the get company services unprocessable entity response
func (o *GetCompanyServicesUnprocessableEntity) Code() int {
	return 422
}

func (o *GetCompanyServicesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetCompanyServicesUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetCompanyServicesUnprocessableEntity) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetCompanyServicesUnprocessableEntity) 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
}

// NewGetCompanyServicesInternalServerError creates a GetCompanyServicesInternalServerError with default headers values
func NewGetCompanyServicesInternalServerError() *GetCompanyServicesInternalServerError {
	return &GetCompanyServicesInternalServerError{}
}

/*
GetCompanyServicesInternalServerError describes a response with status code 500, with default header values.

Server Internal Error
*/
type GetCompanyServicesInternalServerError struct {
	Payload *sfgate_models.Error
}

// IsSuccess returns true when this get company services internal server error response has a 2xx status code
func (o *GetCompanyServicesInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get company services internal server error response has a 3xx status code
func (o *GetCompanyServicesInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get company services internal server error response has a 4xx status code
func (o *GetCompanyServicesInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get company services internal server error response has a 5xx status code
func (o *GetCompanyServicesInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get company services internal server error response a status code equal to that given
func (o *GetCompanyServicesInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get company services internal server error response
func (o *GetCompanyServicesInternalServerError) Code() int {
	return 500
}

func (o *GetCompanyServicesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCompanyServicesInternalServerError) String() string {
	return fmt.Sprintf("[GET /companyservices][%d] getCompanyServicesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetCompanyServicesInternalServerError) GetPayload() *sfgate_models.Error {
	return o.Payload
}

func (o *GetCompanyServicesInternalServerError) 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
}
