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

package admin

// 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"
)

// AdminGetRunnerRegistrationTokenReader is a Reader for the AdminGetRunnerRegistrationToken structure.
type AdminGetRunnerRegistrationTokenReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AdminGetRunnerRegistrationTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAdminGetRunnerRegistrationTokenOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	default:
		return nil, runtime.NewAPIError("[GET /admin/runners/registration-token] adminGetRunnerRegistrationToken", response, response.Code())
	}
}

// NewAdminGetRunnerRegistrationTokenOK creates a AdminGetRunnerRegistrationTokenOK with default headers values
func NewAdminGetRunnerRegistrationTokenOK() *AdminGetRunnerRegistrationTokenOK {
	return &AdminGetRunnerRegistrationTokenOK{}
}

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

RegistrationToken is response related to registration token
*/
type AdminGetRunnerRegistrationTokenOK struct {
	Token string
}

// IsSuccess returns true when this admin get runner registration token o k response has a 2xx status code
func (o *AdminGetRunnerRegistrationTokenOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this admin get runner registration token o k response has a 3xx status code
func (o *AdminGetRunnerRegistrationTokenOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this admin get runner registration token o k response has a 4xx status code
func (o *AdminGetRunnerRegistrationTokenOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this admin get runner registration token o k response has a 5xx status code
func (o *AdminGetRunnerRegistrationTokenOK) IsServerError() bool {
	return false
}

// IsCode returns true when this admin get runner registration token o k response a status code equal to that given
func (o *AdminGetRunnerRegistrationTokenOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the admin get runner registration token o k response
func (o *AdminGetRunnerRegistrationTokenOK) Code() int {
	return 200
}

func (o *AdminGetRunnerRegistrationTokenOK) Error() string {
	return fmt.Sprintf("[GET /admin/runners/registration-token][%d] adminGetRunnerRegistrationTokenOK", 200)
}

func (o *AdminGetRunnerRegistrationTokenOK) String() string {
	return fmt.Sprintf("[GET /admin/runners/registration-token][%d] adminGetRunnerRegistrationTokenOK", 200)
}

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

	// hydrates response header token
	hdrToken := response.GetHeader("token")

	if hdrToken != "" {
		o.Token = hdrToken
	}

	return nil
}
