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