github.com/minio/console@v1.4.1/models/peer_info_remove.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 models 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 "context" 27 28 "github.com/go-openapi/errors" 29 "github.com/go-openapi/strfmt" 30 "github.com/go-openapi/swag" 31 "github.com/go-openapi/validate" 32 ) 33 34 // PeerInfoRemove peer info remove 35 // 36 // swagger:model peerInfoRemove 37 type PeerInfoRemove struct { 38 39 // all 40 All bool `json:"all,omitempty"` 41 42 // sites 43 // Required: true 44 Sites []string `json:"sites"` 45 } 46 47 // Validate validates this peer info remove 48 func (m *PeerInfoRemove) Validate(formats strfmt.Registry) error { 49 var res []error 50 51 if err := m.validateSites(formats); err != nil { 52 res = append(res, err) 53 } 54 55 if len(res) > 0 { 56 return errors.CompositeValidationError(res...) 57 } 58 return nil 59 } 60 61 func (m *PeerInfoRemove) validateSites(formats strfmt.Registry) error { 62 63 if err := validate.Required("sites", "body", m.Sites); err != nil { 64 return err 65 } 66 67 return nil 68 } 69 70 // ContextValidate validates this peer info remove based on context it is used 71 func (m *PeerInfoRemove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 72 return nil 73 } 74 75 // MarshalBinary interface implementation 76 func (m *PeerInfoRemove) MarshalBinary() ([]byte, error) { 77 if m == nil { 78 return nil, nil 79 } 80 return swag.WriteJSON(m) 81 } 82 83 // UnmarshalBinary interface implementation 84 func (m *PeerInfoRemove) UnmarshalBinary(b []byte) error { 85 var res PeerInfoRemove 86 if err := swag.ReadJSON(b, &res); err != nil { 87 return err 88 } 89 *m = res 90 return nil 91 }