github.com/minio/console@v1.4.1/api/operations/idp/delete_configuration_urlbuilder.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 idp 21 22 // This file was generated by the swagger tool. 23 // Editing this file might prove futile when you re-run the generate command 24 25 import ( 26 "errors" 27 "net/url" 28 golangswaggerpaths "path" 29 "strings" 30 ) 31 32 // DeleteConfigurationURL generates an URL for the delete configuration operation 33 type DeleteConfigurationURL struct { 34 Name string 35 Type string 36 37 _basePath string 38 // avoid unkeyed usage 39 _ struct{} 40 } 41 42 // WithBasePath sets the base path for this url builder, only required when it's different from the 43 // base path specified in the swagger spec. 44 // When the value of the base path is an empty string 45 func (o *DeleteConfigurationURL) WithBasePath(bp string) *DeleteConfigurationURL { 46 o.SetBasePath(bp) 47 return o 48 } 49 50 // SetBasePath sets the base path for this url builder, only required when it's different from the 51 // base path specified in the swagger spec. 52 // When the value of the base path is an empty string 53 func (o *DeleteConfigurationURL) SetBasePath(bp string) { 54 o._basePath = bp 55 } 56 57 // Build a url path and query string 58 func (o *DeleteConfigurationURL) Build() (*url.URL, error) { 59 var _result url.URL 60 61 var _path = "/idp/{type}/{name}" 62 63 name := o.Name 64 if name != "" { 65 _path = strings.Replace(_path, "{name}", name, -1) 66 } else { 67 return nil, errors.New("name is required on DeleteConfigurationURL") 68 } 69 70 typeVar := o.Type 71 if typeVar != "" { 72 _path = strings.Replace(_path, "{type}", typeVar, -1) 73 } else { 74 return nil, errors.New("type is required on DeleteConfigurationURL") 75 } 76 77 _basePath := o._basePath 78 if _basePath == "" { 79 _basePath = "/api/v1" 80 } 81 _result.Path = golangswaggerpaths.Join(_basePath, _path) 82 83 return &_result, nil 84 } 85 86 // Must is a helper function to panic when the url builder returns an error 87 func (o *DeleteConfigurationURL) Must(u *url.URL, err error) *url.URL { 88 if err != nil { 89 panic(err) 90 } 91 if u == nil { 92 panic("url can't be nil") 93 } 94 return u 95 } 96 97 // String returns the string representation of the path with query string 98 func (o *DeleteConfigurationURL) String() string { 99 return o.Must(o.Build()).String() 100 } 101 102 // BuildFull builds a full url with scheme, host, path and query string 103 func (o *DeleteConfigurationURL) BuildFull(scheme, host string) (*url.URL, error) { 104 if scheme == "" { 105 return nil, errors.New("scheme is required for a full url on DeleteConfigurationURL") 106 } 107 if host == "" { 108 return nil, errors.New("host is required for a full url on DeleteConfigurationURL") 109 } 110 111 base, err := o.Build() 112 if err != nil { 113 return nil, err 114 } 115 116 base.Scheme = scheme 117 base.Host = host 118 return base, nil 119 } 120 121 // StringFull returns the string representation of a complete url 122 func (o *DeleteConfigurationURL) StringFull(scheme, host string) string { 123 return o.Must(o.BuildFull(scheme, host)).String() 124 }