github.com/minio/console@v1.4.1/api/operations/user/list_a_user_service_accounts_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 user 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 // ListAUserServiceAccountsOKCode is the HTTP code returned for type ListAUserServiceAccountsOK 34 const ListAUserServiceAccountsOKCode int = 200 35 36 /* 37 ListAUserServiceAccountsOK A successful response. 38 39 swagger:response listAUserServiceAccountsOK 40 */ 41 type ListAUserServiceAccountsOK struct { 42 43 /* 44 In: Body 45 */ 46 Payload models.ServiceAccounts `json:"body,omitempty"` 47 } 48 49 // NewListAUserServiceAccountsOK creates ListAUserServiceAccountsOK with default headers values 50 func NewListAUserServiceAccountsOK() *ListAUserServiceAccountsOK { 51 52 return &ListAUserServiceAccountsOK{} 53 } 54 55 // WithPayload adds the payload to the list a user service accounts o k response 56 func (o *ListAUserServiceAccountsOK) WithPayload(payload models.ServiceAccounts) *ListAUserServiceAccountsOK { 57 o.Payload = payload 58 return o 59 } 60 61 // SetPayload sets the payload to the list a user service accounts o k response 62 func (o *ListAUserServiceAccountsOK) SetPayload(payload models.ServiceAccounts) { 63 o.Payload = payload 64 } 65 66 // WriteResponse to the client 67 func (o *ListAUserServiceAccountsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 68 69 rw.WriteHeader(200) 70 payload := o.Payload 71 if payload == nil { 72 // return empty array 73 payload = models.ServiceAccounts{} 74 } 75 76 if err := producer.Produce(rw, payload); err != nil { 77 panic(err) // let the recovery middleware deal with this 78 } 79 } 80 81 /* 82 ListAUserServiceAccountsDefault Generic error response. 83 84 swagger:response listAUserServiceAccountsDefault 85 */ 86 type ListAUserServiceAccountsDefault struct { 87 _statusCode int 88 89 /* 90 In: Body 91 */ 92 Payload *models.APIError `json:"body,omitempty"` 93 } 94 95 // NewListAUserServiceAccountsDefault creates ListAUserServiceAccountsDefault with default headers values 96 func NewListAUserServiceAccountsDefault(code int) *ListAUserServiceAccountsDefault { 97 if code <= 0 { 98 code = 500 99 } 100 101 return &ListAUserServiceAccountsDefault{ 102 _statusCode: code, 103 } 104 } 105 106 // WithStatusCode adds the status to the list a user service accounts default response 107 func (o *ListAUserServiceAccountsDefault) WithStatusCode(code int) *ListAUserServiceAccountsDefault { 108 o._statusCode = code 109 return o 110 } 111 112 // SetStatusCode sets the status to the list a user service accounts default response 113 func (o *ListAUserServiceAccountsDefault) SetStatusCode(code int) { 114 o._statusCode = code 115 } 116 117 // WithPayload adds the payload to the list a user service accounts default response 118 func (o *ListAUserServiceAccountsDefault) WithPayload(payload *models.APIError) *ListAUserServiceAccountsDefault { 119 o.Payload = payload 120 return o 121 } 122 123 // SetPayload sets the payload to the list a user service accounts default response 124 func (o *ListAUserServiceAccountsDefault) SetPayload(payload *models.APIError) { 125 o.Payload = payload 126 } 127 128 // WriteResponse to the client 129 func (o *ListAUserServiceAccountsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 130 131 rw.WriteHeader(o._statusCode) 132 if o.Payload != nil { 133 payload := o.Payload 134 if err := producer.Produce(rw, payload); err != nil { 135 panic(err) // let the recovery middleware deal with this 136 } 137 } 138 }