github.com/minio/console@v1.4.1/api/operations/group/add_group_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 group 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 // AddGroupCreatedCode is the HTTP code returned for type AddGroupCreated 34 const AddGroupCreatedCode int = 201 35 36 /* 37 AddGroupCreated A successful response. 38 39 swagger:response addGroupCreated 40 */ 41 type AddGroupCreated struct { 42 } 43 44 // NewAddGroupCreated creates AddGroupCreated with default headers values 45 func NewAddGroupCreated() *AddGroupCreated { 46 47 return &AddGroupCreated{} 48 } 49 50 // WriteResponse to the client 51 func (o *AddGroupCreated) 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 AddGroupDefault Generic error response. 60 61 swagger:response addGroupDefault 62 */ 63 type AddGroupDefault struct { 64 _statusCode int 65 66 /* 67 In: Body 68 */ 69 Payload *models.APIError `json:"body,omitempty"` 70 } 71 72 // NewAddGroupDefault creates AddGroupDefault with default headers values 73 func NewAddGroupDefault(code int) *AddGroupDefault { 74 if code <= 0 { 75 code = 500 76 } 77 78 return &AddGroupDefault{ 79 _statusCode: code, 80 } 81 } 82 83 // WithStatusCode adds the status to the add group default response 84 func (o *AddGroupDefault) WithStatusCode(code int) *AddGroupDefault { 85 o._statusCode = code 86 return o 87 } 88 89 // SetStatusCode sets the status to the add group default response 90 func (o *AddGroupDefault) SetStatusCode(code int) { 91 o._statusCode = code 92 } 93 94 // WithPayload adds the payload to the add group default response 95 func (o *AddGroupDefault) WithPayload(payload *models.APIError) *AddGroupDefault { 96 o.Payload = payload 97 return o 98 } 99 100 // SetPayload sets the payload to the add group default response 101 func (o *AddGroupDefault) SetPayload(payload *models.APIError) { 102 o.Payload = payload 103 } 104 105 // WriteResponse to the client 106 func (o *AddGroupDefault) 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 }