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

package organization

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// OrgAddTeamRepositoryReader is a Reader for the OrgAddTeamRepository structure.
type OrgAddTeamRepositoryReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *OrgAddTeamRepositoryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 204:
		result := NewOrgAddTeamRepositoryNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewOrgAddTeamRepositoryForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewOrgAddTeamRepositoryNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[PUT /teams/{id}/repos/{org}/{repo}] orgAddTeamRepository", response, response.Code())
	}
}

// NewOrgAddTeamRepositoryNoContent creates a OrgAddTeamRepositoryNoContent with default headers values
func NewOrgAddTeamRepositoryNoContent() *OrgAddTeamRepositoryNoContent {
	return &OrgAddTeamRepositoryNoContent{}
}

/*
OrgAddTeamRepositoryNoContent describes a response with status code 204, with default header values.

APIEmpty is an empty response
*/
type OrgAddTeamRepositoryNoContent struct {
}

// IsSuccess returns true when this org add team repository no content response has a 2xx status code
func (o *OrgAddTeamRepositoryNoContent) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this org add team repository no content response has a 3xx status code
func (o *OrgAddTeamRepositoryNoContent) IsRedirect() bool {
	return false
}

// IsClientError returns true when this org add team repository no content response has a 4xx status code
func (o *OrgAddTeamRepositoryNoContent) IsClientError() bool {
	return false
}

// IsServerError returns true when this org add team repository no content response has a 5xx status code
func (o *OrgAddTeamRepositoryNoContent) IsServerError() bool {
	return false
}

// IsCode returns true when this org add team repository no content response a status code equal to that given
func (o *OrgAddTeamRepositoryNoContent) IsCode(code int) bool {
	return code == 204
}

// Code gets the status code for the org add team repository no content response
func (o *OrgAddTeamRepositoryNoContent) Code() int {
	return 204
}

func (o *OrgAddTeamRepositoryNoContent) Error() string {
	return fmt.Sprintf("[PUT /teams/{id}/repos/{org}/{repo}][%d] orgAddTeamRepositoryNoContent", 204)
}

func (o *OrgAddTeamRepositoryNoContent) String() string {
	return fmt.Sprintf("[PUT /teams/{id}/repos/{org}/{repo}][%d] orgAddTeamRepositoryNoContent", 204)
}

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

	return nil
}

// NewOrgAddTeamRepositoryForbidden creates a OrgAddTeamRepositoryForbidden with default headers values
func NewOrgAddTeamRepositoryForbidden() *OrgAddTeamRepositoryForbidden {
	return &OrgAddTeamRepositoryForbidden{}
}

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

APIForbiddenError is a forbidden error response
*/
type OrgAddTeamRepositoryForbidden struct {
	Message string
	URL     string
}

// IsSuccess returns true when this org add team repository forbidden response has a 2xx status code
func (o *OrgAddTeamRepositoryForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this org add team repository forbidden response has a 3xx status code
func (o *OrgAddTeamRepositoryForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this org add team repository forbidden response has a 4xx status code
func (o *OrgAddTeamRepositoryForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this org add team repository forbidden response has a 5xx status code
func (o *OrgAddTeamRepositoryForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this org add team repository forbidden response a status code equal to that given
func (o *OrgAddTeamRepositoryForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the org add team repository forbidden response
func (o *OrgAddTeamRepositoryForbidden) Code() int {
	return 403
}

func (o *OrgAddTeamRepositoryForbidden) Error() string {
	return fmt.Sprintf("[PUT /teams/{id}/repos/{org}/{repo}][%d] orgAddTeamRepositoryForbidden", 403)
}

func (o *OrgAddTeamRepositoryForbidden) String() string {
	return fmt.Sprintf("[PUT /teams/{id}/repos/{org}/{repo}][%d] orgAddTeamRepositoryForbidden", 403)
}

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

	// hydrates response header message
	hdrMessage := response.GetHeader("message")

	if hdrMessage != "" {
		o.Message = hdrMessage
	}

	// hydrates response header url
	hdrURL := response.GetHeader("url")

	if hdrURL != "" {
		o.URL = hdrURL
	}

	return nil
}

// NewOrgAddTeamRepositoryNotFound creates a OrgAddTeamRepositoryNotFound with default headers values
func NewOrgAddTeamRepositoryNotFound() *OrgAddTeamRepositoryNotFound {
	return &OrgAddTeamRepositoryNotFound{}
}

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

APINotFound is a not found empty response
*/
type OrgAddTeamRepositoryNotFound struct {
}

// IsSuccess returns true when this org add team repository not found response has a 2xx status code
func (o *OrgAddTeamRepositoryNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this org add team repository not found response has a 3xx status code
func (o *OrgAddTeamRepositoryNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this org add team repository not found response has a 4xx status code
func (o *OrgAddTeamRepositoryNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this org add team repository not found response has a 5xx status code
func (o *OrgAddTeamRepositoryNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this org add team repository not found response a status code equal to that given
func (o *OrgAddTeamRepositoryNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the org add team repository not found response
func (o *OrgAddTeamRepositoryNotFound) Code() int {
	return 404
}

func (o *OrgAddTeamRepositoryNotFound) Error() string {
	return fmt.Sprintf("[PUT /teams/{id}/repos/{org}/{repo}][%d] orgAddTeamRepositoryNotFound", 404)
}

func (o *OrgAddTeamRepositoryNotFound) String() string {
	return fmt.Sprintf("[PUT /teams/{id}/repos/{org}/{repo}][%d] orgAddTeamRepositoryNotFound", 404)
}

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

	return nil
}
