github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/schema/schema_objects_shards_update_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 // SchemaObjectsShardsUpdateURL generates an URL for the schema objects shards update operation 27 type SchemaObjectsShardsUpdateURL struct { 28 ClassName string 29 ShardName string 30 31 _basePath string 32 // avoid unkeyed usage 33 _ struct{} 34 } 35 36 // WithBasePath sets the base path for this url builder, only required when it's different from the 37 // base path specified in the swagger spec. 38 // When the value of the base path is an empty string 39 func (o *SchemaObjectsShardsUpdateURL) WithBasePath(bp string) *SchemaObjectsShardsUpdateURL { 40 o.SetBasePath(bp) 41 return o 42 } 43 44 // SetBasePath sets the base path for this url builder, only required when it's different from the 45 // base path specified in the swagger spec. 46 // When the value of the base path is an empty string 47 func (o *SchemaObjectsShardsUpdateURL) SetBasePath(bp string) { 48 o._basePath = bp 49 } 50 51 // Build a url path and query string 52 func (o *SchemaObjectsShardsUpdateURL) Build() (*url.URL, error) { 53 var _result url.URL 54 55 var _path = "/schema/{className}/shards/{shardName}" 56 57 className := o.ClassName 58 if className != "" { 59 _path = strings.Replace(_path, "{className}", className, -1) 60 } else { 61 return nil, errors.New("className is required on SchemaObjectsShardsUpdateURL") 62 } 63 64 shardName := o.ShardName 65 if shardName != "" { 66 _path = strings.Replace(_path, "{shardName}", shardName, -1) 67 } else { 68 return nil, errors.New("shardName is required on SchemaObjectsShardsUpdateURL") 69 } 70 71 _basePath := o._basePath 72 if _basePath == "" { 73 _basePath = "/v1" 74 } 75 _result.Path = golangswaggerpaths.Join(_basePath, _path) 76 77 return &_result, nil 78 } 79 80 // Must is a helper function to panic when the url builder returns an error 81 func (o *SchemaObjectsShardsUpdateURL) Must(u *url.URL, err error) *url.URL { 82 if err != nil { 83 panic(err) 84 } 85 if u == nil { 86 panic("url can't be nil") 87 } 88 return u 89 } 90 91 // String returns the string representation of the path with query string 92 func (o *SchemaObjectsShardsUpdateURL) String() string { 93 return o.Must(o.Build()).String() 94 } 95 96 // BuildFull builds a full url with scheme, host, path and query string 97 func (o *SchemaObjectsShardsUpdateURL) BuildFull(scheme, host string) (*url.URL, error) { 98 if scheme == "" { 99 return nil, errors.New("scheme is required for a full url on SchemaObjectsShardsUpdateURL") 100 } 101 if host == "" { 102 return nil, errors.New("host is required for a full url on SchemaObjectsShardsUpdateURL") 103 } 104 105 base, err := o.Build() 106 if err != nil { 107 return nil, err 108 } 109 110 base.Scheme = scheme 111 base.Host = host 112 return base, nil 113 } 114 115 // StringFull returns the string representation of a complete url 116 func (o *SchemaObjectsShardsUpdateURL) StringFull(scheme, host string) string { 117 return o.Must(o.BuildFull(scheme, host)).String() 118 }