github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/examples/file-server/client/uploads/upload_file_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package uploads
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"fmt"
    10  
    11  	"github.com/go-openapi/runtime"
    12  	"github.com/go-openapi/strfmt"
    13  )
    14  
    15  // UploadFileReader is a Reader for the UploadFile structure.
    16  type UploadFileReader struct {
    17  	formats strfmt.Registry
    18  }
    19  
    20  // ReadResponse reads a server response into the received o.
    21  func (o *UploadFileReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    22  	switch response.Code() {
    23  	case 200:
    24  		result := NewUploadFileOK()
    25  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    26  			return nil, err
    27  		}
    28  		return result, nil
    29  	default:
    30  		return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
    31  	}
    32  }
    33  
    34  // NewUploadFileOK creates a UploadFileOK with default headers values
    35  func NewUploadFileOK() *UploadFileOK {
    36  	return &UploadFileOK{}
    37  }
    38  
    39  /*
    40  	UploadFileOK describes a response with status code 200, with default header values.
    41  
    42  OK
    43  */
    44  type UploadFileOK struct {
    45  }
    46  
    47  // IsSuccess returns true when this upload file o k response returns a 2xx status code
    48  func (o *UploadFileOK) IsSuccess() bool {
    49  	return true
    50  }
    51  
    52  // IsRedirect returns true when this upload file o k response returns a 3xx status code
    53  func (o *UploadFileOK) IsRedirect() bool {
    54  	return false
    55  }
    56  
    57  // IsClientError returns true when this upload file o k response returns a 4xx status code
    58  func (o *UploadFileOK) IsClientError() bool {
    59  	return false
    60  }
    61  
    62  // IsServerError returns true when this upload file o k response returns a 5xx status code
    63  func (o *UploadFileOK) IsServerError() bool {
    64  	return false
    65  }
    66  
    67  // IsCode returns true when this upload file o k response returns a 4xx status code
    68  func (o *UploadFileOK) IsCode(code int) bool {
    69  	return code == 200
    70  }
    71  
    72  func (o *UploadFileOK) Error() string {
    73  	return fmt.Sprintf("[POST /upload][%d] uploadFileOK ", 200)
    74  }
    75  
    76  func (o *UploadFileOK) String() string {
    77  	return fmt.Sprintf("[POST /upload][%d] uploadFileOK ", 200)
    78  }
    79  
    80  func (o *UploadFileOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    81  
    82  	return nil
    83  }