github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/objects/objects_class_delete_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 objects 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 "github.com/go-openapi/strfmt" 26 ) 27 28 // ObjectsClassDeleteURL generates an URL for the objects class delete operation 29 type ObjectsClassDeleteURL struct { 30 ClassName string 31 ID strfmt.UUID 32 33 ConsistencyLevel *string 34 Tenant *string 35 36 _basePath string 37 // avoid unkeyed usage 38 _ struct{} 39 } 40 41 // WithBasePath sets the base path for this url builder, only required when it's different from the 42 // base path specified in the swagger spec. 43 // When the value of the base path is an empty string 44 func (o *ObjectsClassDeleteURL) WithBasePath(bp string) *ObjectsClassDeleteURL { 45 o.SetBasePath(bp) 46 return o 47 } 48 49 // SetBasePath sets the base path for this url builder, only required when it's different from the 50 // base path specified in the swagger spec. 51 // When the value of the base path is an empty string 52 func (o *ObjectsClassDeleteURL) SetBasePath(bp string) { 53 o._basePath = bp 54 } 55 56 // Build a url path and query string 57 func (o *ObjectsClassDeleteURL) Build() (*url.URL, error) { 58 var _result url.URL 59 60 var _path = "/objects/{className}/{id}" 61 62 className := o.ClassName 63 if className != "" { 64 _path = strings.Replace(_path, "{className}", className, -1) 65 } else { 66 return nil, errors.New("className is required on ObjectsClassDeleteURL") 67 } 68 69 id := o.ID.String() 70 if id != "" { 71 _path = strings.Replace(_path, "{id}", id, -1) 72 } else { 73 return nil, errors.New("id is required on ObjectsClassDeleteURL") 74 } 75 76 _basePath := o._basePath 77 if _basePath == "" { 78 _basePath = "/v1" 79 } 80 _result.Path = golangswaggerpaths.Join(_basePath, _path) 81 82 qs := make(url.Values) 83 84 var consistencyLevelQ string 85 if o.ConsistencyLevel != nil { 86 consistencyLevelQ = *o.ConsistencyLevel 87 } 88 if consistencyLevelQ != "" { 89 qs.Set("consistency_level", consistencyLevelQ) 90 } 91 92 var tenantQ string 93 if o.Tenant != nil { 94 tenantQ = *o.Tenant 95 } 96 if tenantQ != "" { 97 qs.Set("tenant", tenantQ) 98 } 99 100 _result.RawQuery = qs.Encode() 101 102 return &_result, nil 103 } 104 105 // Must is a helper function to panic when the url builder returns an error 106 func (o *ObjectsClassDeleteURL) Must(u *url.URL, err error) *url.URL { 107 if err != nil { 108 panic(err) 109 } 110 if u == nil { 111 panic("url can't be nil") 112 } 113 return u 114 } 115 116 // String returns the string representation of the path with query string 117 func (o *ObjectsClassDeleteURL) String() string { 118 return o.Must(o.Build()).String() 119 } 120 121 // BuildFull builds a full url with scheme, host, path and query string 122 func (o *ObjectsClassDeleteURL) BuildFull(scheme, host string) (*url.URL, error) { 123 if scheme == "" { 124 return nil, errors.New("scheme is required for a full url on ObjectsClassDeleteURL") 125 } 126 if host == "" { 127 return nil, errors.New("host is required for a full url on ObjectsClassDeleteURL") 128 } 129 130 base, err := o.Build() 131 if err != nil { 132 return nil, err 133 } 134 135 base.Scheme = scheme 136 base.Host = host 137 return base, nil 138 } 139 140 // StringFull returns the string representation of a complete url 141 func (o *ObjectsClassDeleteURL) StringFull(scheme, host string) string { 142 return o.Must(o.BuildFull(scheme, host)).String() 143 }