github.com/minio/console@v1.4.1/models/list_external_buckets_params.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 // ListExternalBucketsParams list external buckets params 35 // 36 // swagger:model listExternalBucketsParams 37 type ListExternalBucketsParams struct { 38 39 // access key 40 // Required: true 41 // Min Length: 3 42 AccessKey *string `json:"accessKey"` 43 44 // region 45 Region string `json:"region,omitempty"` 46 47 // secret key 48 // Required: true 49 // Min Length: 8 50 SecretKey *string `json:"secretKey"` 51 52 // target URL 53 // Required: true 54 TargetURL *string `json:"targetURL"` 55 56 // use TLS 57 // Required: true 58 UseTLS *bool `json:"useTLS"` 59 } 60 61 // Validate validates this list external buckets params 62 func (m *ListExternalBucketsParams) Validate(formats strfmt.Registry) error { 63 var res []error 64 65 if err := m.validateAccessKey(formats); err != nil { 66 res = append(res, err) 67 } 68 69 if err := m.validateSecretKey(formats); err != nil { 70 res = append(res, err) 71 } 72 73 if err := m.validateTargetURL(formats); err != nil { 74 res = append(res, err) 75 } 76 77 if err := m.validateUseTLS(formats); err != nil { 78 res = append(res, err) 79 } 80 81 if len(res) > 0 { 82 return errors.CompositeValidationError(res...) 83 } 84 return nil 85 } 86 87 func (m *ListExternalBucketsParams) validateAccessKey(formats strfmt.Registry) error { 88 89 if err := validate.Required("accessKey", "body", m.AccessKey); err != nil { 90 return err 91 } 92 93 if err := validate.MinLength("accessKey", "body", *m.AccessKey, 3); err != nil { 94 return err 95 } 96 97 return nil 98 } 99 100 func (m *ListExternalBucketsParams) validateSecretKey(formats strfmt.Registry) error { 101 102 if err := validate.Required("secretKey", "body", m.SecretKey); err != nil { 103 return err 104 } 105 106 if err := validate.MinLength("secretKey", "body", *m.SecretKey, 8); err != nil { 107 return err 108 } 109 110 return nil 111 } 112 113 func (m *ListExternalBucketsParams) validateTargetURL(formats strfmt.Registry) error { 114 115 if err := validate.Required("targetURL", "body", m.TargetURL); err != nil { 116 return err 117 } 118 119 return nil 120 } 121 122 func (m *ListExternalBucketsParams) validateUseTLS(formats strfmt.Registry) error { 123 124 if err := validate.Required("useTLS", "body", m.UseTLS); err != nil { 125 return err 126 } 127 128 return nil 129 } 130 131 // ContextValidate validates this list external buckets params based on context it is used 132 func (m *ListExternalBucketsParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 133 return nil 134 } 135 136 // MarshalBinary interface implementation 137 func (m *ListExternalBucketsParams) MarshalBinary() ([]byte, error) { 138 if m == nil { 139 return nil, nil 140 } 141 return swag.WriteJSON(m) 142 } 143 144 // UnmarshalBinary interface implementation 145 func (m *ListExternalBucketsParams) UnmarshalBinary(b []byte) error { 146 var res ListExternalBucketsParams 147 if err := swag.ReadJSON(b, &res); err != nil { 148 return err 149 } 150 *m = res 151 return nil 152 }