github.com/minio/console@v1.4.1/api/operations/public/download_shared_object_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // This file is part of MinIO Console Server
     4  // Copyright (c) 2023 MinIO, Inc.
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU Affero General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // (at your option) any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU Affero General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU Affero General Public License
    17  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    18  //
    19  
    20  package public
    21  
    22  // This file was generated by the swagger tool.
    23  // Editing this file might prove futile when you re-run the swagger generate command
    24  
    25  import (
    26  	"io"
    27  	"net/http"
    28  
    29  	"github.com/go-openapi/runtime"
    30  
    31  	"github.com/minio/console/models"
    32  )
    33  
    34  // DownloadSharedObjectOKCode is the HTTP code returned for type DownloadSharedObjectOK
    35  const DownloadSharedObjectOKCode int = 200
    36  
    37  /*
    38  DownloadSharedObjectOK A successful response.
    39  
    40  swagger:response downloadSharedObjectOK
    41  */
    42  type DownloadSharedObjectOK struct {
    43  
    44  	/*
    45  	  In: Body
    46  	*/
    47  	Payload io.ReadCloser `json:"body,omitempty"`
    48  }
    49  
    50  // NewDownloadSharedObjectOK creates DownloadSharedObjectOK with default headers values
    51  func NewDownloadSharedObjectOK() *DownloadSharedObjectOK {
    52  
    53  	return &DownloadSharedObjectOK{}
    54  }
    55  
    56  // WithPayload adds the payload to the download shared object o k response
    57  func (o *DownloadSharedObjectOK) WithPayload(payload io.ReadCloser) *DownloadSharedObjectOK {
    58  	o.Payload = payload
    59  	return o
    60  }
    61  
    62  // SetPayload sets the payload to the download shared object o k response
    63  func (o *DownloadSharedObjectOK) SetPayload(payload io.ReadCloser) {
    64  	o.Payload = payload
    65  }
    66  
    67  // WriteResponse to the client
    68  func (o *DownloadSharedObjectOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    69  
    70  	rw.WriteHeader(200)
    71  	payload := o.Payload
    72  	if err := producer.Produce(rw, payload); err != nil {
    73  		panic(err) // let the recovery middleware deal with this
    74  	}
    75  }
    76  
    77  /*
    78  DownloadSharedObjectDefault Generic error response.
    79  
    80  swagger:response downloadSharedObjectDefault
    81  */
    82  type DownloadSharedObjectDefault struct {
    83  	_statusCode int
    84  
    85  	/*
    86  	  In: Body
    87  	*/
    88  	Payload *models.APIError `json:"body,omitempty"`
    89  }
    90  
    91  // NewDownloadSharedObjectDefault creates DownloadSharedObjectDefault with default headers values
    92  func NewDownloadSharedObjectDefault(code int) *DownloadSharedObjectDefault {
    93  	if code <= 0 {
    94  		code = 500
    95  	}
    96  
    97  	return &DownloadSharedObjectDefault{
    98  		_statusCode: code,
    99  	}
   100  }
   101  
   102  // WithStatusCode adds the status to the download shared object default response
   103  func (o *DownloadSharedObjectDefault) WithStatusCode(code int) *DownloadSharedObjectDefault {
   104  	o._statusCode = code
   105  	return o
   106  }
   107  
   108  // SetStatusCode sets the status to the download shared object default response
   109  func (o *DownloadSharedObjectDefault) SetStatusCode(code int) {
   110  	o._statusCode = code
   111  }
   112  
   113  // WithPayload adds the payload to the download shared object default response
   114  func (o *DownloadSharedObjectDefault) WithPayload(payload *models.APIError) *DownloadSharedObjectDefault {
   115  	o.Payload = payload
   116  	return o
   117  }
   118  
   119  // SetPayload sets the payload to the download shared object default response
   120  func (o *DownloadSharedObjectDefault) SetPayload(payload *models.APIError) {
   121  	o.Payload = payload
   122  }
   123  
   124  // WriteResponse to the client
   125  func (o *DownloadSharedObjectDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   126  
   127  	rw.WriteHeader(o._statusCode)
   128  	if o.Payload != nil {
   129  		payload := o.Payload
   130  		if err := producer.Produce(rw, payload); err != nil {
   131  			panic(err) // let the recovery middleware deal with this
   132  		}
   133  	}
   134  }