github.com/minio/console@v1.4.1/api/operations/profile/profiling_stop_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 profile 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 // ProfilingStopCreatedCode is the HTTP code returned for type ProfilingStopCreated 35 const ProfilingStopCreatedCode int = 201 36 37 /* 38 ProfilingStopCreated A successful response. 39 40 swagger:response profilingStopCreated 41 */ 42 type ProfilingStopCreated struct { 43 44 /* 45 In: Body 46 */ 47 Payload io.ReadCloser `json:"body,omitempty"` 48 } 49 50 // NewProfilingStopCreated creates ProfilingStopCreated with default headers values 51 func NewProfilingStopCreated() *ProfilingStopCreated { 52 53 return &ProfilingStopCreated{} 54 } 55 56 // WithPayload adds the payload to the profiling stop created response 57 func (o *ProfilingStopCreated) WithPayload(payload io.ReadCloser) *ProfilingStopCreated { 58 o.Payload = payload 59 return o 60 } 61 62 // SetPayload sets the payload to the profiling stop created response 63 func (o *ProfilingStopCreated) SetPayload(payload io.ReadCloser) { 64 o.Payload = payload 65 } 66 67 // WriteResponse to the client 68 func (o *ProfilingStopCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 69 70 rw.WriteHeader(201) 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 ProfilingStopDefault Generic error response. 79 80 swagger:response profilingStopDefault 81 */ 82 type ProfilingStopDefault struct { 83 _statusCode int 84 85 /* 86 In: Body 87 */ 88 Payload *models.APIError `json:"body,omitempty"` 89 } 90 91 // NewProfilingStopDefault creates ProfilingStopDefault with default headers values 92 func NewProfilingStopDefault(code int) *ProfilingStopDefault { 93 if code <= 0 { 94 code = 500 95 } 96 97 return &ProfilingStopDefault{ 98 _statusCode: code, 99 } 100 } 101 102 // WithStatusCode adds the status to the profiling stop default response 103 func (o *ProfilingStopDefault) WithStatusCode(code int) *ProfilingStopDefault { 104 o._statusCode = code 105 return o 106 } 107 108 // SetStatusCode sets the status to the profiling stop default response 109 func (o *ProfilingStopDefault) SetStatusCode(code int) { 110 o._statusCode = code 111 } 112 113 // WithPayload adds the payload to the profiling stop default response 114 func (o *ProfilingStopDefault) WithPayload(payload *models.APIError) *ProfilingStopDefault { 115 o.Payload = payload 116 return o 117 } 118 119 // SetPayload sets the payload to the profiling stop default response 120 func (o *ProfilingStopDefault) SetPayload(payload *models.APIError) { 121 o.Payload = payload 122 } 123 124 // WriteResponse to the client 125 func (o *ProfilingStopDefault) 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 }