github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/schema/schema_objects_get_urlbuilder.go (about) 1 // _ _ 2 // __ _____ __ ___ ___ __ _| |_ ___ 3 // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ 4 // \ V V / __/ (_| |\ V /| | (_| | || __/ 5 // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| 6 // 7 // Copyright © 2016 - 2024 Weaviate B.V. All rights reserved. 8 // 9 // CONTACT: hello@weaviate.io 10 // 11 12 // Code generated by go-swagger; DO NOT EDIT. 13 14 package schema 15 16 // This file was generated by the swagger tool. 17 // Editing this file might prove futile when you re-run the generate command 18 19 import ( 20 "errors" 21 "net/url" 22 golangswaggerpaths "path" 23 "strings" 24 ) 25 26 // SchemaObjectsGetURL generates an URL for the schema objects get operation 27 type SchemaObjectsGetURL struct { 28 ClassName string 29 30 _basePath string 31 // avoid unkeyed usage 32 _ struct{} 33 } 34 35 // WithBasePath sets the base path for this url builder, only required when it's different from the 36 // base path specified in the swagger spec. 37 // When the value of the base path is an empty string 38 func (o *SchemaObjectsGetURL) WithBasePath(bp string) *SchemaObjectsGetURL { 39 o.SetBasePath(bp) 40 return o 41 } 42 43 // SetBasePath sets the base path for this url builder, only required when it's different from the 44 // base path specified in the swagger spec. 45 // When the value of the base path is an empty string 46 func (o *SchemaObjectsGetURL) SetBasePath(bp string) { 47 o._basePath = bp 48 } 49 50 // Build a url path and query string 51 func (o *SchemaObjectsGetURL) Build() (*url.URL, error) { 52 var _result url.URL 53 54 var _path = "/schema/{className}" 55 56 className := o.ClassName 57 if className != "" { 58 _path = strings.Replace(_path, "{className}", className, -1) 59 } else { 60 return nil, errors.New("className is required on SchemaObjectsGetURL") 61 } 62 63 _basePath := o._basePath 64 if _basePath == "" { 65 _basePath = "/v1" 66 } 67 _result.Path = golangswaggerpaths.Join(_basePath, _path) 68 69 return &_result, nil 70 } 71 72 // Must is a helper function to panic when the url builder returns an error 73 func (o *SchemaObjectsGetURL) Must(u *url.URL, err error) *url.URL { 74 if err != nil { 75 panic(err) 76 } 77 if u == nil { 78 panic("url can't be nil") 79 } 80 return u 81 } 82 83 // String returns the string representation of the path with query string 84 func (o *SchemaObjectsGetURL) String() string { 85 return o.Must(o.Build()).String() 86 } 87 88 // BuildFull builds a full url with scheme, host, path and query string 89 func (o *SchemaObjectsGetURL) BuildFull(scheme, host string) (*url.URL, error) { 90 if scheme == "" { 91 return nil, errors.New("scheme is required for a full url on SchemaObjectsGetURL") 92 } 93 if host == "" { 94 return nil, errors.New("host is required for a full url on SchemaObjectsGetURL") 95 } 96 97 base, err := o.Build() 98 if err != nil { 99 return nil, err 100 } 101 102 base.Scheme = scheme 103 base.Host = host 104 return base, nil 105 } 106 107 // StringFull returns the string representation of a complete url 108 func (o *SchemaObjectsGetURL) StringFull(scheme, host string) string { 109 return o.Must(o.BuildFull(scheme, host)).String() 110 }