github.com/minio/console@v1.4.1/api/operations/k_m_s/k_m_s_create_key_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 k_m_s 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 "net/http" 27 28 "github.com/go-openapi/runtime" 29 30 "github.com/minio/console/models" 31 ) 32 33 // KMSCreateKeyCreatedCode is the HTTP code returned for type KMSCreateKeyCreated 34 const KMSCreateKeyCreatedCode int = 201 35 36 /* 37 KMSCreateKeyCreated A successful response. 38 39 swagger:response kMSCreateKeyCreated 40 */ 41 type KMSCreateKeyCreated struct { 42 } 43 44 // NewKMSCreateKeyCreated creates KMSCreateKeyCreated with default headers values 45 func NewKMSCreateKeyCreated() *KMSCreateKeyCreated { 46 47 return &KMSCreateKeyCreated{} 48 } 49 50 // WriteResponse to the client 51 func (o *KMSCreateKeyCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 52 53 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 54 55 rw.WriteHeader(201) 56 } 57 58 /* 59 KMSCreateKeyDefault Generic error response. 60 61 swagger:response kMSCreateKeyDefault 62 */ 63 type KMSCreateKeyDefault struct { 64 _statusCode int 65 66 /* 67 In: Body 68 */ 69 Payload *models.APIError `json:"body,omitempty"` 70 } 71 72 // NewKMSCreateKeyDefault creates KMSCreateKeyDefault with default headers values 73 func NewKMSCreateKeyDefault(code int) *KMSCreateKeyDefault { 74 if code <= 0 { 75 code = 500 76 } 77 78 return &KMSCreateKeyDefault{ 79 _statusCode: code, 80 } 81 } 82 83 // WithStatusCode adds the status to the k m s create key default response 84 func (o *KMSCreateKeyDefault) WithStatusCode(code int) *KMSCreateKeyDefault { 85 o._statusCode = code 86 return o 87 } 88 89 // SetStatusCode sets the status to the k m s create key default response 90 func (o *KMSCreateKeyDefault) SetStatusCode(code int) { 91 o._statusCode = code 92 } 93 94 // WithPayload adds the payload to the k m s create key default response 95 func (o *KMSCreateKeyDefault) WithPayload(payload *models.APIError) *KMSCreateKeyDefault { 96 o.Payload = payload 97 return o 98 } 99 100 // SetPayload sets the payload to the k m s create key default response 101 func (o *KMSCreateKeyDefault) SetPayload(payload *models.APIError) { 102 o.Payload = payload 103 } 104 105 // WriteResponse to the client 106 func (o *KMSCreateKeyDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 107 108 rw.WriteHeader(o._statusCode) 109 if o.Payload != nil { 110 payload := o.Payload 111 if err := producer.Produce(rw, payload); err != nil { 112 panic(err) // let the recovery middleware deal with this 113 } 114 } 115 }