diff --git a/go.mod b/go.mod index c32a2f1a6..87eceefa7 100644 --- a/go.mod +++ b/go.mod @@ -3,17 +3,17 @@ module github.com/tidepool-org/hydrophone go 1.22 require ( - github.com/aws/aws-sdk-go v1.54.0 + github.com/aws/aws-sdk-go v1.54.11 github.com/golang/mock v1.6.0 github.com/gorilla/mux v1.8.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/oapi-codegen/runtime v1.1.1 github.com/pkg/errors v0.9.1 - github.com/tidepool-org/clinic/client v0.0.0-20240612205715-a4a56080b4f7 + github.com/tidepool-org/clinic/client v0.0.0-20240629034458-1365c8963143 github.com/tidepool-org/go-common v0.12.2-0.20240612192926-de6d5c5a742c - github.com/tidepool-org/platform v1.33.1-0.20240412022409-2d52339c4886 - go.mongodb.org/mongo-driver v1.15.0 - go.uber.org/fx v1.22.0 + github.com/tidepool-org/platform v1.33.1-0.20240710040908-039dbee20943 + go.mongodb.org/mongo-driver v1.16.0 + go.uber.org/fx v1.22.1 go.uber.org/zap v1.27.0 ) @@ -30,7 +30,6 @@ require ( github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -63,6 +62,4 @@ require ( golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect - google.golang.org/appengine v1.6.8 // indirect - google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/go.sum b/go.sum index e789b26f3..e5f101d48 100644 --- a/go.sum +++ b/go.sum @@ -7,12 +7,8 @@ github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7D github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/aws/aws-sdk-go v1.50.6 h1:FaXvNwHG3Ri1paUEW16Ahk9zLVqSAdqa1M3phjZR35Q= -github.com/aws/aws-sdk-go v1.50.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= -github.com/aws/aws-sdk-go v1.54.0 h1:tGCQ6YS2TepzKtbl+ddXnLIoV8XvWdxMKtuMxdrsa4U= -github.com/aws/aws-sdk-go v1.54.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/aws/aws-sdk-go v1.54.11 h1:Zxuv/R+IVS0B66yz4uezhxH9FN9/G2nbxejYqAMFjxk= +github.com/aws/aws-sdk-go v1.54.11/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= @@ -33,26 +29,19 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240125082051-42cd04596328 h1:oI+lCI2DY1BsRrdzMJBhIMxBBdlZJl31YNQC11EiyvA= -github.com/google/pprof v0.0.0-20240125082051-42cd04596328/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0 h1:e+8XbKB6IMn8A4OAyZccO4pYfB3s7bt6azNIPE7AnPg= +github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -88,7 +77,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -100,15 +88,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -130,12 +117,12 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tidepool-org/clinic/client v0.0.0-20240612205715-a4a56080b4f7 h1:u0oIIiqfg/kQlC0ctdTqb4di5EyGayNAhsoMF1JKDAs= -github.com/tidepool-org/clinic/client v0.0.0-20240612205715-a4a56080b4f7/go.mod h1:7BpAdFdGJNB3aw/xvCz5XnWjSWRoUtWIX4xcMc4Bsko= +github.com/tidepool-org/clinic/client v0.0.0-20240629034458-1365c8963143 h1:A6qFjC5yMhC0xMfcci4lo3/tVq1k2q5Jt/BjsP3NtdQ= +github.com/tidepool-org/clinic/client v0.0.0-20240629034458-1365c8963143/go.mod h1:7BpAdFdGJNB3aw/xvCz5XnWjSWRoUtWIX4xcMc4Bsko= github.com/tidepool-org/go-common v0.12.2-0.20240612192926-de6d5c5a742c h1:hJZyiHNGeqyLA/5p60/0H9CZtJi4fAuzOuyQF0TpF7E= github.com/tidepool-org/go-common v0.12.2-0.20240612192926-de6d5c5a742c/go.mod h1:mIzYteUyPf//fhee4e2KEZhmcm2iE4IQ/2dyQr5pRKA= -github.com/tidepool-org/platform v1.33.1-0.20240412022409-2d52339c4886 h1:QRQAUTRmKUtv7jmP+4dP746ApmC7P0M1ypVRYH8O+QY= -github.com/tidepool-org/platform v1.33.1-0.20240412022409-2d52339c4886/go.mod h1:QMsN1a7sB5ujIhjYAI1abn26AajH6dCokCJ0OIq1DWI= +github.com/tidepool-org/platform v1.33.1-0.20240710040908-039dbee20943 h1:sR3A9XydVHSyqa46hPKdWDYQHHrZegXH9djgBo/1Koc= +github.com/tidepool-org/platform v1.33.1-0.20240710040908-039dbee20943/go.mod h1:OyPtHmUjGwXg/n0MSaw6E2WuIFvSm/HG/k9NuKG6CJM= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= @@ -148,25 +135,16 @@ github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw= github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4= github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 h1:tBiBTKHnIjovYoLX/TPkcf+OjqqKGQrPtGT3Foz+Pgo= github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76/go.mod h1:SQliXeA7Dhkt//vS29v3zpbEwoa+zb2Cn5xj5uO4K5U= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= -go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= -go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.mongodb.org/mongo-driver v1.16.0 h1:tpRsfBJMROVHKpdGyc1BBEzzjDUWjItxbVSZ8Ls4BQ4= +go.mongodb.org/mongo-driver v1.16.0/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw= go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= -go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk= -go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg= -go.uber.org/fx v1.22.0 h1:pApUK7yL0OUHMd8vkunWSlLxZVFFk70jR2nKde8X2NM= -go.uber.org/fx v1.22.0/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= +go.uber.org/fx v1.22.1 h1:nvvln7mwyT5s1q201YE29V/BFrGor6vMiDNpU/78Mys= +go.uber.org/fx v1.22.1/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -175,9 +153,7 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= @@ -188,14 +164,11 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -207,7 +180,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -220,7 +192,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -232,16 +203,11 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 54a93239e..0b985a1f8 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -1079,6 +1079,9 @@ var awsPartition = partition{ endpointKey{ Region: "ap-southeast-2", }: endpoint{}, + endpointKey{ + Region: "ca-central-1", + }: endpoint{}, endpointKey{ Region: "eu-central-1", }: endpoint{}, @@ -1091,6 +1094,9 @@ var awsPartition = partition{ endpointKey{ Region: "eu-west-3", }: endpoint{}, + endpointKey{ + Region: "sa-east-1", + }: endpoint{}, endpointKey{ Region: "us-east-1", }: endpoint{}, @@ -20938,6 +20944,9 @@ var awsPartition = partition{ }, "meetings-chime": service{ Endpoints: serviceEndpoints{ + endpointKey{ + Region: "af-south-1", + }: endpoint{}, endpointKey{ Region: "ap-northeast-1", }: endpoint{}, @@ -20956,6 +20965,21 @@ var awsPartition = partition{ endpointKey{ Region: "ca-central-1", }: endpoint{}, + endpointKey{ + Region: "ca-central-1", + Variant: fipsVariant, + }: endpoint{ + Hostname: "meetings-chime-fips.ca-central-1.amazonaws.com", + }, + endpointKey{ + Region: "ca-central-1-fips", + }: endpoint{ + Hostname: "meetings-chime-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + Deprecated: boxedTrue, + }, endpointKey{ Region: "eu-central-1", }: endpoint{}, @@ -36075,6 +36099,18 @@ var awscnPartition = partition{ }: endpoint{}, }, }, + "acm-pca": service{ + Defaults: endpointDefaults{ + defaultKey{}: endpoint{ + Protocols: []string{"https"}, + }, + }, + Endpoints: serviceEndpoints{ + endpointKey{ + Region: "cn-north-1", + }: endpoint{}, + }, + }, "airflow": service{ Endpoints: serviceEndpoints{ endpointKey{ @@ -41977,6 +42013,62 @@ var awsusgovPartition = partition{ }: endpoint{}, }, }, + "kinesisvideo": service{ + Endpoints: serviceEndpoints{ + endpointKey{ + Region: "fips-us-gov-east-1", + }: endpoint{ + Hostname: "kinesisvideo-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: boxedTrue, + }, + endpointKey{ + Region: "fips-us-gov-west-1", + }: endpoint{ + Hostname: "kinesisvideo-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: boxedTrue, + }, + endpointKey{ + Region: "us-gov-east-1", + }: endpoint{ + Hostname: "kinesisvideo-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + endpointKey{ + Region: "us-gov-east-1", + Variant: fipsVariant, + }: endpoint{ + Hostname: "kinesisvideo-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + endpointKey{ + Region: "us-gov-west-1", + }: endpoint{ + Hostname: "kinesisvideo-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + endpointKey{ + Region: "us-gov-west-1", + Variant: fipsVariant, + }: endpoint{ + Hostname: "kinesisvideo-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "kms": service{ Endpoints: serviceEndpoints{ endpointKey{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 929357349..12ea1b328 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.54.0" +const SDKVersion = "1.54.11" diff --git a/vendor/github.com/tidepool-org/clinic/client/client.go b/vendor/github.com/tidepool-org/clinic/client/client.go index 0b1337603..9bb1174d0 100644 --- a/vendor/github.com/tidepool-org/clinic/client/client.go +++ b/vendor/github.com/tidepool-org/clinic/client/client.go @@ -247,6 +247,11 @@ type ClientInterface interface { // SendUploadReminder request SendUploadReminder(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) + // AddServiceAccountWithBody request with any body + AddServiceAccountWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AddServiceAccount(ctx context.Context, clinicId ClinicId, body AddServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetEHRSettings request GetEHRSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -287,6 +292,9 @@ type ClientInterface interface { // FindPatients request FindPatients(ctx context.Context, params *FindPatientsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // SyncEHRDataForPatient request + SyncEHRDataForPatient(ctx context.Context, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpdatePatientSummaryWithBody request with any body UpdatePatientSummaryWithBody(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1033,6 +1041,30 @@ func (c *Client) SendUploadReminder(ctx context.Context, clinicId ClinicId, pati return c.Client.Do(req) } +func (c *Client) AddServiceAccountWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddServiceAccountRequestWithBody(c.Server, clinicId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) AddServiceAccount(ctx context.Context, clinicId ClinicId, body AddServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAddServiceAccountRequest(c.Server, clinicId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetEHRSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetEHRSettingsRequest(c.Server, clinicId) if err != nil { @@ -1213,6 +1245,18 @@ func (c *Client) FindPatients(ctx context.Context, params *FindPatientsParams, r return c.Client.Do(req) } +func (c *Client) SyncEHRDataForPatient(ctx context.Context, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSyncEHRDataForPatientRequest(c.Server, patientId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) UpdatePatientSummaryWithBody(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdatePatientSummaryRequestWithBody(c.Server, patientId, contentType, body) if err != nil { @@ -2929,12 +2973,1132 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien return nil, err } - if params != nil { - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() + + if params.Search != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Sort != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortType != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortType", runtime.ParamLocationQuery, *params.SortType); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Period != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "period", runtime.ParamLocationQuery, *params.Period); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.OffsetPeriods != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offsetPeriods", runtime.ParamLocationQuery, *params.OffsetPeriods); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmAverageGlucoseMmol != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageGlucoseMmol", runtime.ParamLocationQuery, *params.CgmAverageGlucoseMmol); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmGlucoseManagementIndicator != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.glucoseManagementIndicator", runtime.ParamLocationQuery, *params.CgmGlucoseManagementIndicator); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeCGMUsePercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUsePercent", runtime.ParamLocationQuery, *params.CgmTimeCGMUsePercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInTargetPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetPercent", runtime.ParamLocationQuery, *params.CgmTimeInTargetPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInExtremeHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInExtremeHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInExtremeHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeCGMUseMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseMinutes", runtime.ParamLocationQuery, *params.CgmTimeCGMUseMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryLowMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowMinutes", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyLowMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowMinutes", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInLowMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowMinutes", runtime.ParamLocationQuery, *params.CgmTimeInLowMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInTargetMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetMinutes", runtime.ParamLocationQuery, *params.CgmTimeInTargetMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInHighMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighMinutes", runtime.ParamLocationQuery, *params.CgmTimeInHighMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryHighMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighMinutes", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInExtremeHighMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInExtremeHighMinutes", runtime.ParamLocationQuery, *params.CgmTimeInExtremeHighMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyHighMinutes != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighMinutes", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighMinutes); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeCGMUseRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseRecords", runtime.ParamLocationQuery, *params.CgmTimeCGMUseRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInTargetRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetRecords", runtime.ParamLocationQuery, *params.CgmTimeInTargetRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmAverageDailyRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageDailyRecords", runtime.ParamLocationQuery, *params.CgmAverageDailyRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTotalRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.totalRecords", runtime.ParamLocationQuery, *params.CgmTotalRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmHoursWithData != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.hoursWithData", runtime.ParamLocationQuery, *params.CgmHoursWithData); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmDaysWithData != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.daysWithData", runtime.ParamLocationQuery, *params.CgmDaysWithData); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmStandardDeviation != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.standardDeviation", runtime.ParamLocationQuery, *params.CgmStandardDeviation); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmCoefficientOfVariation != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.coefficientOfVariation", runtime.ParamLocationQuery, *params.CgmCoefficientOfVariation); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmAverageGlucoseMmol != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageGlucoseMmol", runtime.ParamLocationQuery, *params.BgmAverageGlucoseMmol); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInAnyLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInTargetPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetPercent", runtime.ParamLocationQuery, *params.BgmTimeInTargetPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInExtremeHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInExtremeHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInExtremeHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInAnyHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInAnyLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInTargetRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetRecords", runtime.ParamLocationQuery, *params.BgmTimeInTargetRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInAnyHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmAverageDailyRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageDailyRecords", runtime.ParamLocationQuery, *params.BgmAverageDailyRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTotalRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.totalRecords", runtime.ParamLocationQuery, *params.BgmTotalRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmAverageGlucoseMmolDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageGlucoseMmolDelta", runtime.ParamLocationQuery, *params.CgmAverageGlucoseMmolDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmGlucoseManagementIndicatorDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.glucoseManagementIndicatorDelta", runtime.ParamLocationQuery, *params.CgmGlucoseManagementIndicatorDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeCGMUsePercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUsePercentDelta", runtime.ParamLocationQuery, *params.CgmTimeCGMUsePercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryLowPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyLowPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInLowPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInLowPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInTargetPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInTargetPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInHighPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInHighPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryHighPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInExtremeHighPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInExtremeHighPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInExtremeHighPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInAnyHighPercentDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighPercentDelta", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighPercentDelta); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - if params.Search != nil { + } - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + if params.CgmTimeCGMUseMinutesDelta != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeCGMUseMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -2948,9 +4112,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.Offset != nil { + if params.CgmTimeInVeryLowMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -2964,9 +4128,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.Limit != nil { + if params.CgmTimeInAnyLowMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -2980,9 +4144,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.Sort != nil { + if params.CgmTimeInLowMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInLowMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -2996,9 +4160,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.SortType != nil { + if params.CgmTimeInTargetMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortType", runtime.ParamLocationQuery, *params.SortType); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInTargetMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3012,9 +4176,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.Period != nil { + if params.CgmTimeInHighMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "period", runtime.ParamLocationQuery, *params.Period); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInHighMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3028,9 +4192,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.OffsetPeriods != nil { + if params.CgmTimeInVeryHighMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offsetPeriods", runtime.ParamLocationQuery, *params.OffsetPeriods); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3044,9 +4208,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeCGMUsePercent != nil { + if params.CgmTimeInExtremeHighMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUsePercent", runtime.ParamLocationQuery, *params.CgmTimeCGMUsePercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInExtremeHighMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInExtremeHighMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3060,9 +4224,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInVeryLowPercent != nil { + if params.CgmTimeInAnyHighMinutesDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighMinutesDelta", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighMinutesDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3076,9 +4240,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInAnyLowPercent != nil { + if params.CgmTimeCGMUseRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeCGMUseRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3092,9 +4256,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInLowPercent != nil { + if params.CgmTimeInVeryLowRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInLowPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3108,9 +4272,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInTargetPercent != nil { + if params.CgmTimeInAnyLowRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetPercent", runtime.ParamLocationQuery, *params.CgmTimeInTargetPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3124,9 +4288,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInHighPercent != nil { + if params.CgmTimeInLowRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInHighPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInLowRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3140,9 +4304,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInVeryHighPercent != nil { + if params.CgmTimeInTargetRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInTargetRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3156,9 +4320,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInAnyHighPercent != nil { + if params.CgmTimeInHighRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInHighRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3172,9 +4336,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeCGMUseRecords != nil { + if params.CgmTimeInVeryHighRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseRecords", runtime.ParamLocationQuery, *params.CgmTimeCGMUseRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3188,9 +4352,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInVeryLowRecords != nil { + if params.CgmTimeInAnyHighRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighRecordsDelta", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3204,9 +4368,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInAnyLowRecords != nil { + if params.CgmAverageDailyRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInAnyLowRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageDailyRecordsDelta", runtime.ParamLocationQuery, *params.CgmAverageDailyRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3220,9 +4384,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInLowRecords != nil { + if params.CgmTotalRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInLowRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.totalRecordsDelta", runtime.ParamLocationQuery, *params.CgmTotalRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3236,9 +4400,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInTargetRecords != nil { + if params.CgmHoursWithDataDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetRecords", runtime.ParamLocationQuery, *params.CgmTimeInTargetRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.hoursWithDataDelta", runtime.ParamLocationQuery, *params.CgmHoursWithDataDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3252,9 +4416,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInHighRecords != nil { + if params.CgmDaysWithDataDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInHighRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.daysWithDataDelta", runtime.ParamLocationQuery, *params.CgmDaysWithDataDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3268,9 +4432,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInVeryHighRecords != nil { + if params.CgmStandardDeviationDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.standardDeviationDelta", runtime.ParamLocationQuery, *params.CgmStandardDeviationDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3284,9 +4448,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTimeInAnyHighRecords != nil { + if params.CgmCoefficientOfVariationDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInAnyHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInAnyHighRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.coefficientOfVariationDelta", runtime.ParamLocationQuery, *params.CgmCoefficientOfVariationDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3300,9 +4464,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmAverageDailyRecords != nil { + if params.CgmLastUploadDateFrom != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageDailyRecords", runtime.ParamLocationQuery, *params.CgmAverageDailyRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.lastUploadDateFrom", runtime.ParamLocationQuery, *params.CgmLastUploadDateFrom); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3316,9 +4480,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmTotalRecords != nil { + if params.CgmLastUploadDateTo != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.totalRecords", runtime.ParamLocationQuery, *params.CgmTotalRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.lastUploadDateTo", runtime.ParamLocationQuery, *params.CgmLastUploadDateTo); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3332,9 +4496,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmLastUploadDateFrom != nil { + if params.BgmAverageGlucoseMmolDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.lastUploadDateFrom", runtime.ParamLocationQuery, *params.CgmLastUploadDateFrom); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageGlucoseMmolDelta", runtime.ParamLocationQuery, *params.BgmAverageGlucoseMmolDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3348,9 +4512,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.CgmLastUploadDateTo != nil { + if params.BgmTimeInVeryLowPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.lastUploadDateTo", runtime.ParamLocationQuery, *params.CgmLastUploadDateTo); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3364,9 +4528,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInVeryLowPercent != nil { + if params.BgmTimeInAnyLowPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3380,9 +4544,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInAnyLowPercent != nil { + if params.BgmTimeInLowPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInLowPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3396,9 +4560,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInLowPercent != nil { + if params.BgmTimeInTargetPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInLowPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInTargetPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3412,9 +4576,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInTargetPercent != nil { + if params.BgmTimeInHighPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetPercent", runtime.ParamLocationQuery, *params.BgmTimeInTargetPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInHighPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3428,9 +4592,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInHighPercent != nil { + if params.BgmTimeInVeryHighPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInHighPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3444,9 +4608,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInVeryHighPercent != nil { + if params.BgmTimeInExtremeHighPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInExtremeHighPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInExtremeHighPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3460,9 +4624,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInAnyHighPercent != nil { + if params.BgmTimeInAnyHighPercentDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighPercent); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighPercentDelta", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighPercentDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3476,9 +4640,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInVeryLowRecords != nil { + if params.BgmTimeInVeryLowRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3492,9 +4656,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInAnyLowRecords != nil { + if params.BgmTimeInAnyLowRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyLowRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInAnyLowRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3508,9 +4672,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInLowRecords != nil { + if params.BgmTimeInLowRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInLowRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInLowRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3524,9 +4688,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInTargetRecords != nil { + if params.BgmTimeInTargetRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetRecords", runtime.ParamLocationQuery, *params.BgmTimeInTargetRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInTargetRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3540,9 +4704,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInHighRecords != nil { + if params.BgmTimeInHighRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInHighRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInHighRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3556,9 +4720,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInVeryHighRecords != nil { + if params.BgmTimeInVeryHighRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3572,9 +4736,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTimeInAnyHighRecords != nil { + if params.BgmTimeInAnyHighRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInAnyHighRecordsDelta", runtime.ParamLocationQuery, *params.BgmTimeInAnyHighRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3588,9 +4752,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmAverageDailyRecords != nil { + if params.BgmAverageDailyRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageDailyRecords", runtime.ParamLocationQuery, *params.BgmAverageDailyRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageDailyRecordsDelta", runtime.ParamLocationQuery, *params.BgmAverageDailyRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -3604,9 +4768,9 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien } - if params.BgmTotalRecords != nil { + if params.BgmTotalRecordsDelta != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.totalRecords", runtime.ParamLocationQuery, *params.BgmTotalRecords); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.totalRecordsDelta", runtime.ParamLocationQuery, *params.BgmTotalRecordsDelta); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -4208,6 +5372,53 @@ func NewSendUploadReminderRequest(server string, clinicId ClinicId, patientId Pa return req, nil } +// NewAddServiceAccountRequest calls the generic AddServiceAccount builder with application/json body +func NewAddServiceAccountRequest(server string, clinicId ClinicId, body AddServiceAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewAddServiceAccountRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewAddServiceAccountRequestWithBody generates requests for AddServiceAccount with any type of body +func NewAddServiceAccountRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/service_accounts", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewGetEHRSettingsRequest generates requests for GetEHRSettings func NewGetEHRSettingsRequest(server string, clinicId ClinicId) (*http.Request, error) { var err error @@ -4778,6 +5989,40 @@ func NewFindPatientsRequest(server string, params *FindPatientsParams) (*http.Re return req, nil } +// NewSyncEHRDataForPatientRequest generates requests for SyncEHRDataForPatient +func NewSyncEHRDataForPatientRequest(server string, patientId PatientId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/patients/%s/ehr/sync", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewUpdatePatientSummaryRequest calls the generic UpdatePatientSummary builder with application/json body func NewUpdatePatientSummaryRequest(server string, patientId PatientId, body UpdatePatientSummaryJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader @@ -5509,6 +6754,11 @@ type ClientWithResponsesInterface interface { // SendUploadReminderWithResponse request SendUploadReminderWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendUploadReminderResponse, error) + // AddServiceAccountWithBodyWithResponse request with any body + AddServiceAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddServiceAccountResponse, error) + + AddServiceAccountWithResponse(ctx context.Context, clinicId ClinicId, body AddServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddServiceAccountResponse, error) + // GetEHRSettingsWithResponse request GetEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetEHRSettingsResponse, error) @@ -5549,6 +6799,9 @@ type ClientWithResponsesInterface interface { // FindPatientsWithResponse request FindPatientsWithResponse(ctx context.Context, params *FindPatientsParams, reqEditors ...RequestEditorFn) (*FindPatientsResponse, error) + // SyncEHRDataForPatientWithResponse request + SyncEHRDataForPatientWithResponse(ctx context.Context, patientId PatientId, reqEditors ...RequestEditorFn) (*SyncEHRDataForPatientResponse, error) + // UpdatePatientSummaryWithBodyWithResponse request with any body UpdatePatientSummaryWithBodyWithResponse(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) @@ -6491,6 +7744,27 @@ func (r SendUploadReminderResponse) StatusCode() int { return 0 } +type AddServiceAccountResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r AddServiceAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AddServiceAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type GetEHRSettingsResponse struct { Body []byte HTTPResponse *http.Response @@ -6706,6 +7980,27 @@ func (r FindPatientsResponse) StatusCode() int { return 0 } +type SyncEHRDataForPatientResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r SyncEHRDataForPatientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SyncEHRDataForPatientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + type UpdatePatientSummaryResponse struct { Body []byte HTTPResponse *http.Response @@ -7486,6 +8781,23 @@ func (c *ClientWithResponses) SendUploadReminderWithResponse(ctx context.Context return ParseSendUploadReminderResponse(rsp) } +// AddServiceAccountWithBodyWithResponse request with arbitrary body returning *AddServiceAccountResponse +func (c *ClientWithResponses) AddServiceAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddServiceAccountResponse, error) { + rsp, err := c.AddServiceAccountWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddServiceAccountResponse(rsp) +} + +func (c *ClientWithResponses) AddServiceAccountWithResponse(ctx context.Context, clinicId ClinicId, body AddServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddServiceAccountResponse, error) { + rsp, err := c.AddServiceAccount(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAddServiceAccountResponse(rsp) +} + // GetEHRSettingsWithResponse request returning *GetEHRSettingsResponse func (c *ClientWithResponses) GetEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetEHRSettingsResponse, error) { rsp, err := c.GetEHRSettings(ctx, clinicId, reqEditors...) @@ -7616,6 +8928,15 @@ func (c *ClientWithResponses) FindPatientsWithResponse(ctx context.Context, para return ParseFindPatientsResponse(rsp) } +// SyncEHRDataForPatientWithResponse request returning *SyncEHRDataForPatientResponse +func (c *ClientWithResponses) SyncEHRDataForPatientWithResponse(ctx context.Context, patientId PatientId, reqEditors ...RequestEditorFn) (*SyncEHRDataForPatientResponse, error) { + rsp, err := c.SyncEHRDataForPatient(ctx, patientId, reqEditors...) + if err != nil { + return nil, err + } + return ParseSyncEHRDataForPatientResponse(rsp) +} + // UpdatePatientSummaryWithBodyWithResponse request with arbitrary body returning *UpdatePatientSummaryResponse func (c *ClientWithResponses) UpdatePatientSummaryWithBodyWithResponse(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) { rsp, err := c.UpdatePatientSummaryWithBody(ctx, patientId, contentType, body, reqEditors...) @@ -8727,6 +10048,22 @@ func ParseSendUploadReminderResponse(rsp *http.Response) (*SendUploadReminderRes return response, nil } +// ParseAddServiceAccountResponse parses an HTTP response from a AddServiceAccountWithResponse call +func ParseAddServiceAccountResponse(rsp *http.Response) (*AddServiceAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AddServiceAccountResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseGetEHRSettingsResponse parses an HTTP response from a GetEHRSettingsWithResponse call func ParseGetEHRSettingsResponse(rsp *http.Response) (*GetEHRSettingsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -8937,6 +10274,22 @@ func ParseFindPatientsResponse(rsp *http.Response) (*FindPatientsResponse, error return response, nil } +// ParseSyncEHRDataForPatientResponse parses an HTTP response from a SyncEHRDataForPatientWithResponse call +func ParseSyncEHRDataForPatientResponse(rsp *http.Response) (*SyncEHRDataForPatientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SyncEHRDataForPatientResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseUpdatePatientSummaryResponse parses an HTTP response from a UpdatePatientSummaryWithResponse call func ParseUpdatePatientSummaryResponse(rsp *http.Response) (*UpdatePatientSummaryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/vendor/github.com/tidepool-org/clinic/client/mock.go b/vendor/github.com/tidepool-org/clinic/client/mock.go index 0ab47bd95..151a87321 100644 --- a/vendor/github.com/tidepool-org/clinic/client/mock.go +++ b/vendor/github.com/tidepool-org/clinic/client/mock.go @@ -74,6 +74,46 @@ func (m *MockClientInterface) EXPECT() *MockClientInterfaceMockRecorder { return m.recorder } +// AddServiceAccount mocks base method. +func (m *MockClientInterface) AddServiceAccount(ctx context.Context, clinicId ClinicId, body AddServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddServiceAccount", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddServiceAccount indicates an expected call of AddServiceAccount. +func (mr *MockClientInterfaceMockRecorder) AddServiceAccount(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddServiceAccount", reflect.TypeOf((*MockClientInterface)(nil).AddServiceAccount), varargs...) +} + +// AddServiceAccountWithBody mocks base method. +func (m *MockClientInterface) AddServiceAccountWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddServiceAccountWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddServiceAccountWithBody indicates an expected call of AddServiceAccountWithBody. +func (mr *MockClientInterfaceMockRecorder) AddServiceAccountWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddServiceAccountWithBody", reflect.TypeOf((*MockClientInterface)(nil).AddServiceAccountWithBody), varargs...) +} + // AssignPatientTagToClinicPatients mocks base method. func (m *MockClientInterface) AssignPatientTagToClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1114,6 +1154,26 @@ func (mr *MockClientInterfaceMockRecorder) SyncEHRData(ctx, clinicId interface{} return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncEHRData", reflect.TypeOf((*MockClientInterface)(nil).SyncEHRData), varargs...) } +// SyncEHRDataForPatient mocks base method. +func (m *MockClientInterface) SyncEHRDataForPatient(ctx context.Context, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, patientId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SyncEHRDataForPatient", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncEHRDataForPatient indicates an expected call of SyncEHRDataForPatient. +func (mr *MockClientInterfaceMockRecorder) SyncEHRDataForPatient(ctx, patientId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, patientId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncEHRDataForPatient", reflect.TypeOf((*MockClientInterface)(nil).SyncEHRDataForPatient), varargs...) +} + // TideReport mocks base method. func (m *MockClientInterface) TideReport(ctx context.Context, clinicId ClinicId, params *TideReportParams, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1917,6 +1977,46 @@ func (m *MockClientWithResponsesInterface) EXPECT() *MockClientWithResponsesInte return m.recorder } +// AddServiceAccountWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) AddServiceAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddServiceAccountResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddServiceAccountWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*AddServiceAccountResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddServiceAccountWithBodyWithResponse indicates an expected call of AddServiceAccountWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) AddServiceAccountWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddServiceAccountWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AddServiceAccountWithBodyWithResponse), varargs...) +} + +// AddServiceAccountWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) AddServiceAccountWithResponse(ctx context.Context, clinicId ClinicId, body AddServiceAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AddServiceAccountResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddServiceAccountWithResponse", varargs...) + ret0, _ := ret[0].(*AddServiceAccountResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddServiceAccountWithResponse indicates an expected call of AddServiceAccountWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) AddServiceAccountWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddServiceAccountWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AddServiceAccountWithResponse), varargs...) +} + // AssignPatientTagToClinicPatientsWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) AssignPatientTagToClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) { m.ctrl.T.Helper() @@ -2937,6 +3037,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) SendUploadReminderWithRe return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendUploadReminderWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).SendUploadReminderWithResponse), varargs...) } +// SyncEHRDataForPatientWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) SyncEHRDataForPatientWithResponse(ctx context.Context, patientId PatientId, reqEditors ...RequestEditorFn) (*SyncEHRDataForPatientResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, patientId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SyncEHRDataForPatientWithResponse", varargs...) + ret0, _ := ret[0].(*SyncEHRDataForPatientResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncEHRDataForPatientWithResponse indicates an expected call of SyncEHRDataForPatientWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) SyncEHRDataForPatientWithResponse(ctx, patientId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, patientId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncEHRDataForPatientWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).SyncEHRDataForPatientWithResponse), varargs...) +} + // SyncEHRDataWithResponse mocks base method. func (m *MockClientWithResponsesInterface) SyncEHRDataWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*SyncEHRDataResponse, error) { m.ctrl.T.Helper() diff --git a/vendor/github.com/tidepool-org/clinic/client/types.go b/vendor/github.com/tidepool-org/clinic/client/types.go index a63fd3deb..f09177ecb 100644 --- a/vendor/github.com/tidepool-org/clinic/client/types.go +++ b/vendor/github.com/tidepool-org/clinic/client/types.go @@ -651,7 +651,7 @@ const ( // Defines values for EHRMatchMessageRefEventType. const ( - New EHRMatchMessageRefEventType = "New" + EHRMatchMessageRefEventTypeNew EHRMatchMessageRefEventType = "New" ) // Defines values for EHRSettingsProvider. @@ -667,6 +667,12 @@ const ( RUNNING MigrationStatus = "RUNNING" ) +// Defines values for ScheduledReportsOnUploadNoteEventType. +const ( + ScheduledReportsOnUploadNoteEventTypeNew ScheduledReportsOnUploadNoteEventType = "New" + ScheduledReportsOnUploadNoteEventTypeReplace ScheduledReportsOnUploadNoteEventType = "Replace" +) + // Defines values for Tier. const ( Tier0100 Tier = "tier0100" @@ -681,6 +687,13 @@ const ( FindPatientsParamsWorkspaceIdTypeEhrSourceId FindPatientsParamsWorkspaceIdType = "ehrSourceId" ) +// AddServiceAccount defines model for AddServiceAccount. +type AddServiceAccount struct { + ClientId string `json:"client_id"` + ClientSecret string `json:"client_secret"` + Name string `json:"name"` +} + // AssociateClinicianToUser defines model for AssociateClinicianToUser. type AssociateClinicianToUser struct { UserId string `json:"userId"` @@ -884,7 +897,10 @@ type EHRSettings struct { MrnIdType string `json:"mrnIdType"` ProcedureCodes EHRProcedureCodes `json:"procedureCodes"` Provider EHRSettingsProvider `json:"provider"` - SourceId string `json:"sourceId"` + + // ScheduledReports Scheduled Report Settings + ScheduledReports ScheduledReports `json:"scheduledReports"` + SourceId string `json:"sourceId"` } // EHRSettingsProvider defines model for EHRSettings.Provider. @@ -1512,6 +1528,16 @@ type PhoneNumber struct { Type *string `json:"type,omitempty"` } +// ScheduledReports Scheduled Report Settings +type ScheduledReports struct { + // OnUploadEnabled Send a PDF Report and a Flowsheet to Redox after a dataset is uploaded. + OnUploadEnabled bool `json:"onUploadEnabled"` + OnUploadNoteEventType *ScheduledReportsOnUploadNoteEventType `json:"onUploadNoteEventType,omitempty"` +} + +// ScheduledReportsOnUploadNoteEventType defines model for ScheduledReports.OnUploadNoteEventType. +type ScheduledReportsOnUploadNoteEventType string + // SuppressedNotifications defines model for SuppressedNotifications. type SuppressedNotifications struct { PatientClinicInvitation *bool `json:"patientClinicInvitation,omitempty"` @@ -1753,6 +1779,12 @@ type ListPatientsParams struct { // OffsetPeriods If we should display, filter, and sort based on the offset periods or default periods OffsetPeriods *bool `form:"offsetPeriods,omitempty" json:"offsetPeriods,omitempty"` + // CgmAverageGlucoseMmol Average glucose value of records + CgmAverageGlucoseMmol *string `form:"cgm.averageGlucoseMmol,omitempty" json:"cgm.averageGlucoseMmol,omitempty"` + + // CgmGlucoseManagementIndicator Glucose management Indicator of records + CgmGlucoseManagementIndicator *string `form:"cgm.glucoseManagementIndicator,omitempty" json:"cgm.glucoseManagementIndicator,omitempty"` + // CgmTimeCGMUsePercent Percentage of time of CGM use CgmTimeCGMUsePercent *string `form:"cgm.timeCGMUsePercent,omitempty" json:"cgm.timeCGMUsePercent,omitempty"` @@ -1774,9 +1806,39 @@ type ListPatientsParams struct { // CgmTimeInVeryHighPercent Percentage of time above 250 mg/dL CgmTimeInVeryHighPercent *string `form:"cgm.timeInVeryHighPercent,omitempty" json:"cgm.timeInVeryHighPercent,omitempty"` + // CgmTimeInExtremeHighPercent Percentage of time above 350 mg/dL + CgmTimeInExtremeHighPercent *string `form:"cgm.timeInExtremeHighPercent,omitempty" json:"cgm.timeInExtremeHighPercent,omitempty"` + // CgmTimeInAnyHighPercent Percentage of time above 180 mg/dL CgmTimeInAnyHighPercent *string `form:"cgm.timeInAnyHighPercent,omitempty" json:"cgm.timeInAnyHighPercent,omitempty"` + // CgmTimeCGMUseMinutes Minutesage of time of CGM use + CgmTimeCGMUseMinutes *string `form:"cgm.timeCGMUseMinutes,omitempty" json:"cgm.timeCGMUseMinutes,omitempty"` + + // CgmTimeInVeryLowMinutes Minutesage of time below 54 mg/dL + CgmTimeInVeryLowMinutes *string `form:"cgm.timeInVeryLowMinutes,omitempty" json:"cgm.timeInVeryLowMinutes,omitempty"` + + // CgmTimeInAnyLowMinutes Minutesage of time below 70 mg/dL + CgmTimeInAnyLowMinutes *string `form:"cgm.timeInAnyLowMinutes,omitempty" json:"cgm.timeInAnyLowMinutes,omitempty"` + + // CgmTimeInLowMinutes Minutesage of time in range 54-70 mg/dL + CgmTimeInLowMinutes *string `form:"cgm.timeInLowMinutes,omitempty" json:"cgm.timeInLowMinutes,omitempty"` + + // CgmTimeInTargetMinutes Minutesage of time in range 70-180 mg/dL + CgmTimeInTargetMinutes *string `form:"cgm.timeInTargetMinutes,omitempty" json:"cgm.timeInTargetMinutes,omitempty"` + + // CgmTimeInHighMinutes Minutesage of time in range 180-250 mg/dL + CgmTimeInHighMinutes *string `form:"cgm.timeInHighMinutes,omitempty" json:"cgm.timeInHighMinutes,omitempty"` + + // CgmTimeInVeryHighMinutes Minutesage of time above 250 mg/dL + CgmTimeInVeryHighMinutes *string `form:"cgm.timeInVeryHighMinutes,omitempty" json:"cgm.timeInVeryHighMinutes,omitempty"` + + // CgmTimeInExtremeHighMinutes Minutesage of time above 350 mg/dL + CgmTimeInExtremeHighMinutes *string `form:"cgm.timeInExtremeHighMinutes,omitempty" json:"cgm.timeInExtremeHighMinutes,omitempty"` + + // CgmTimeInAnyHighMinutes Minutesage of time above 180 mg/dL + CgmTimeInAnyHighMinutes *string `form:"cgm.timeInAnyHighMinutes,omitempty" json:"cgm.timeInAnyHighMinutes,omitempty"` + // CgmTimeCGMUseRecords Records of CGM use CgmTimeCGMUseRecords *string `form:"cgm.timeCGMUseRecords,omitempty" json:"cgm.timeCGMUseRecords,omitempty"` @@ -1807,11 +1869,20 @@ type ListPatientsParams struct { // CgmTotalRecords Total records in period CgmTotalRecords *string `form:"cgm.totalRecords,omitempty" json:"cgm.totalRecords,omitempty"` - // CgmLastUploadDateFrom Inclusive - CgmLastUploadDateFrom *time.Time `form:"cgm.lastUploadDateFrom,omitempty" json:"cgm.lastUploadDateFrom,omitempty"` + // CgmHoursWithData Total hours with data in period + CgmHoursWithData *string `form:"cgm.hoursWithData,omitempty" json:"cgm.hoursWithData,omitempty"` - // CgmLastUploadDateTo Exclusive - CgmLastUploadDateTo *time.Time `form:"cgm.lastUploadDateTo,omitempty" json:"cgm.lastUploadDateTo,omitempty"` + // CgmDaysWithData Total days with data in period + CgmDaysWithData *string `form:"cgm.daysWithData,omitempty" json:"cgm.daysWithData,omitempty"` + + // CgmStandardDeviation Standard deviation of records in period + CgmStandardDeviation *string `form:"cgm.standardDeviation,omitempty" json:"cgm.standardDeviation,omitempty"` + + // CgmCoefficientOfVariation Coefficient Of Variation of records in period + CgmCoefficientOfVariation *string `form:"cgm.coefficientOfVariation,omitempty" json:"cgm.coefficientOfVariation,omitempty"` + + // BgmAverageGlucoseMmol Average glucose value of records + BgmAverageGlucoseMmol *string `form:"bgm.averageGlucoseMmol,omitempty" json:"bgm.averageGlucoseMmol,omitempty"` // BgmTimeInVeryLowPercent Percentage of time below 54 mg/dL BgmTimeInVeryLowPercent *string `form:"bgm.timeInVeryLowPercent,omitempty" json:"bgm.timeInVeryLowPercent,omitempty"` @@ -1831,6 +1902,9 @@ type ListPatientsParams struct { // BgmTimeInVeryHighPercent Percentage of time above 250 mg/dL BgmTimeInVeryHighPercent *string `form:"bgm.timeInVeryHighPercent,omitempty" json:"bgm.timeInVeryHighPercent,omitempty"` + // BgmTimeInExtremeHighPercent Percentage of time above 350 mg/dL + BgmTimeInExtremeHighPercent *string `form:"bgm.timeInExtremeHighPercent,omitempty" json:"bgm.timeInExtremeHighPercent,omitempty"` + // BgmTimeInAnyHighPercent Percentage of time above 180 mg/dL BgmTimeInAnyHighPercent *string `form:"bgm.timeInAnyHighPercent,omitempty" json:"bgm.timeInAnyHighPercent,omitempty"` @@ -1861,6 +1935,168 @@ type ListPatientsParams struct { // BgmTotalRecords Total records in period BgmTotalRecords *string `form:"bgm.totalRecords,omitempty" json:"bgm.totalRecords,omitempty"` + // CgmAverageGlucoseMmolDelta Average glucose value of records + CgmAverageGlucoseMmolDelta *string `form:"cgm.averageGlucoseMmolDelta,omitempty" json:"cgm.averageGlucoseMmolDelta,omitempty"` + + // CgmGlucoseManagementIndicatorDelta Glucose management Indicator of records + CgmGlucoseManagementIndicatorDelta *string `form:"cgm.glucoseManagementIndicatorDelta,omitempty" json:"cgm.glucoseManagementIndicatorDelta,omitempty"` + + // CgmTimeCGMUsePercentDelta PercentDeltaage of time of CGM use + CgmTimeCGMUsePercentDelta *string `form:"cgm.timeCGMUsePercentDelta,omitempty" json:"cgm.timeCGMUsePercentDelta,omitempty"` + + // CgmTimeInVeryLowPercentDelta PercentDeltaage of time below 54 mg/dL + CgmTimeInVeryLowPercentDelta *string `form:"cgm.timeInVeryLowPercentDelta,omitempty" json:"cgm.timeInVeryLowPercentDelta,omitempty"` + + // CgmTimeInAnyLowPercentDelta PercentDeltaage of time below 70 mg/dL + CgmTimeInAnyLowPercentDelta *string `form:"cgm.timeInAnyLowPercentDelta,omitempty" json:"cgm.timeInAnyLowPercentDelta,omitempty"` + + // CgmTimeInLowPercentDelta PercentDeltaage of time in range 54-70 mg/dL + CgmTimeInLowPercentDelta *string `form:"cgm.timeInLowPercentDelta,omitempty" json:"cgm.timeInLowPercentDelta,omitempty"` + + // CgmTimeInTargetPercentDelta PercentDeltaage of time in range 70-180 mg/dL + CgmTimeInTargetPercentDelta *string `form:"cgm.timeInTargetPercentDelta,omitempty" json:"cgm.timeInTargetPercentDelta,omitempty"` + + // CgmTimeInHighPercentDelta PercentDeltaage of time in range 180-250 mg/dL + CgmTimeInHighPercentDelta *string `form:"cgm.timeInHighPercentDelta,omitempty" json:"cgm.timeInHighPercentDelta,omitempty"` + + // CgmTimeInVeryHighPercentDelta PercentDeltaage of time above 250 mg/dL + CgmTimeInVeryHighPercentDelta *string `form:"cgm.timeInVeryHighPercentDelta,omitempty" json:"cgm.timeInVeryHighPercentDelta,omitempty"` + + // CgmTimeInExtremeHighPercentDelta PercentDeltaage of time above 350 mg/dL + CgmTimeInExtremeHighPercentDelta *string `form:"cgm.timeInExtremeHighPercentDelta,omitempty" json:"cgm.timeInExtremeHighPercentDelta,omitempty"` + + // CgmTimeInAnyHighPercentDelta PercentDeltaage of time above 180 mg/dL + CgmTimeInAnyHighPercentDelta *string `form:"cgm.timeInAnyHighPercentDelta,omitempty" json:"cgm.timeInAnyHighPercentDelta,omitempty"` + + // CgmTimeCGMUseMinutesDelta MinutesDeltaage of time of CGM use + CgmTimeCGMUseMinutesDelta *string `form:"cgm.timeCGMUseMinutesDelta,omitempty" json:"cgm.timeCGMUseMinutesDelta,omitempty"` + + // CgmTimeInVeryLowMinutesDelta MinutesDeltaage of time below 54 mg/dL + CgmTimeInVeryLowMinutesDelta *string `form:"cgm.timeInVeryLowMinutesDelta,omitempty" json:"cgm.timeInVeryLowMinutesDelta,omitempty"` + + // CgmTimeInAnyLowMinutesDelta MinutesDeltaage of time below 70 mg/dL + CgmTimeInAnyLowMinutesDelta *string `form:"cgm.timeInAnyLowMinutesDelta,omitempty" json:"cgm.timeInAnyLowMinutesDelta,omitempty"` + + // CgmTimeInLowMinutesDelta MinutesDeltaage of time in range 54-70 mg/dL + CgmTimeInLowMinutesDelta *string `form:"cgm.timeInLowMinutesDelta,omitempty" json:"cgm.timeInLowMinutesDelta,omitempty"` + + // CgmTimeInTargetMinutesDelta MinutesDeltaage of time in range 70-180 mg/dL + CgmTimeInTargetMinutesDelta *string `form:"cgm.timeInTargetMinutesDelta,omitempty" json:"cgm.timeInTargetMinutesDelta,omitempty"` + + // CgmTimeInHighMinutesDelta MinutesDeltaage of time in range 180-250 mg/dL + CgmTimeInHighMinutesDelta *string `form:"cgm.timeInHighMinutesDelta,omitempty" json:"cgm.timeInHighMinutesDelta,omitempty"` + + // CgmTimeInVeryHighMinutesDelta MinutesDeltaage of time above 250 mg/dL + CgmTimeInVeryHighMinutesDelta *string `form:"cgm.timeInVeryHighMinutesDelta,omitempty" json:"cgm.timeInVeryHighMinutesDelta,omitempty"` + + // CgmTimeInExtremeHighMinutesDelta MinutesDeltaage of time above 350 mg/dL + CgmTimeInExtremeHighMinutesDelta *string `form:"cgm.timeInExtremeHighMinutesDelta,omitempty" json:"cgm.timeInExtremeHighMinutesDelta,omitempty"` + + // CgmTimeInAnyHighMinutesDelta MinutesDeltaage of time above 180 mg/dL + CgmTimeInAnyHighMinutesDelta *string `form:"cgm.timeInAnyHighMinutesDelta,omitempty" json:"cgm.timeInAnyHighMinutesDelta,omitempty"` + + // CgmTimeCGMUseRecordsDelta RecordsDelta of CGM use + CgmTimeCGMUseRecordsDelta *string `form:"cgm.timeCGMUseRecordsDelta,omitempty" json:"cgm.timeCGMUseRecordsDelta,omitempty"` + + // CgmTimeInVeryLowRecordsDelta RecordsDelta below 54 mg/dL + CgmTimeInVeryLowRecordsDelta *string `form:"cgm.timeInVeryLowRecordsDelta,omitempty" json:"cgm.timeInVeryLowRecordsDelta,omitempty"` + + // CgmTimeInAnyLowRecordsDelta RecordsDelta below 70 mg/dL + CgmTimeInAnyLowRecordsDelta *string `form:"cgm.timeInAnyLowRecordsDelta,omitempty" json:"cgm.timeInAnyLowRecordsDelta,omitempty"` + + // CgmTimeInLowRecordsDelta RecordsDelta in range 54-70 mg/dL + CgmTimeInLowRecordsDelta *string `form:"cgm.timeInLowRecordsDelta,omitempty" json:"cgm.timeInLowRecordsDelta,omitempty"` + + // CgmTimeInTargetRecordsDelta RecordsDelta in range 70-180 mg/dL + CgmTimeInTargetRecordsDelta *string `form:"cgm.timeInTargetRecordsDelta,omitempty" json:"cgm.timeInTargetRecordsDelta,omitempty"` + + // CgmTimeInHighRecordsDelta RecordsDelta in range 180-250 mg/dL + CgmTimeInHighRecordsDelta *string `form:"cgm.timeInHighRecordsDelta,omitempty" json:"cgm.timeInHighRecordsDelta,omitempty"` + + // CgmTimeInVeryHighRecordsDelta RecordsDelta above 250 mg/dL + CgmTimeInVeryHighRecordsDelta *string `form:"cgm.timeInVeryHighRecordsDelta,omitempty" json:"cgm.timeInVeryHighRecordsDelta,omitempty"` + + // CgmTimeInAnyHighRecordsDelta RecordsDelta above 180 mg/dL + CgmTimeInAnyHighRecordsDelta *string `form:"cgm.timeInAnyHighRecordsDelta,omitempty" json:"cgm.timeInAnyHighRecordsDelta,omitempty"` + + // CgmAverageDailyRecordsDelta Average recordsDelta per day + CgmAverageDailyRecordsDelta *string `form:"cgm.averageDailyRecordsDelta,omitempty" json:"cgm.averageDailyRecordsDelta,omitempty"` + + // CgmTotalRecordsDelta Total recordsDelta in period + CgmTotalRecordsDelta *string `form:"cgm.totalRecordsDelta,omitempty" json:"cgm.totalRecordsDelta,omitempty"` + + // CgmHoursWithDataDelta Total hours with data in period + CgmHoursWithDataDelta *string `form:"cgm.hoursWithDataDelta,omitempty" json:"cgm.hoursWithDataDelta,omitempty"` + + // CgmDaysWithDataDelta Total days with data in period + CgmDaysWithDataDelta *string `form:"cgm.daysWithDataDelta,omitempty" json:"cgm.daysWithDataDelta,omitempty"` + + // CgmStandardDeviationDelta Standard deviation of recordsDelta in period + CgmStandardDeviationDelta *string `form:"cgm.standardDeviationDelta,omitempty" json:"cgm.standardDeviationDelta,omitempty"` + + // CgmCoefficientOfVariationDelta Coefficient Of Variation of recordsDelta in period + CgmCoefficientOfVariationDelta *string `form:"cgm.coefficientOfVariationDelta,omitempty" json:"cgm.coefficientOfVariationDelta,omitempty"` + + // CgmLastUploadDateFrom Inclusive + CgmLastUploadDateFrom *time.Time `form:"cgm.lastUploadDateFrom,omitempty" json:"cgm.lastUploadDateFrom,omitempty"` + + // CgmLastUploadDateTo Exclusive + CgmLastUploadDateTo *time.Time `form:"cgm.lastUploadDateTo,omitempty" json:"cgm.lastUploadDateTo,omitempty"` + + // BgmAverageGlucoseMmolDelta Average glucose value of records + BgmAverageGlucoseMmolDelta *string `form:"bgm.averageGlucoseMmolDelta,omitempty" json:"bgm.averageGlucoseMmolDelta,omitempty"` + + // BgmTimeInVeryLowPercentDelta PercentDeltaage of time below 54 mg/dL + BgmTimeInVeryLowPercentDelta *string `form:"bgm.timeInVeryLowPercentDelta,omitempty" json:"bgm.timeInVeryLowPercentDelta,omitempty"` + + // BgmTimeInAnyLowPercentDelta PercentDeltaage of time below 70 mg/dL + BgmTimeInAnyLowPercentDelta *string `form:"bgm.timeInAnyLowPercentDelta,omitempty" json:"bgm.timeInAnyLowPercentDelta,omitempty"` + + // BgmTimeInLowPercentDelta PercentDeltaage of time in range 54-70 mg/dL + BgmTimeInLowPercentDelta *string `form:"bgm.timeInLowPercentDelta,omitempty" json:"bgm.timeInLowPercentDelta,omitempty"` + + // BgmTimeInTargetPercentDelta PercentDeltaage of time in range 70-180 mg/dL + BgmTimeInTargetPercentDelta *string `form:"bgm.timeInTargetPercentDelta,omitempty" json:"bgm.timeInTargetPercentDelta,omitempty"` + + // BgmTimeInHighPercentDelta PercentDeltaage of time in range 180-250 mg/dL + BgmTimeInHighPercentDelta *string `form:"bgm.timeInHighPercentDelta,omitempty" json:"bgm.timeInHighPercentDelta,omitempty"` + + // BgmTimeInVeryHighPercentDelta PercentDeltaage of time above 250 mg/dL + BgmTimeInVeryHighPercentDelta *string `form:"bgm.timeInVeryHighPercentDelta,omitempty" json:"bgm.timeInVeryHighPercentDelta,omitempty"` + + // BgmTimeInExtremeHighPercentDelta PercentDeltaage of time above 350 mg/dL + BgmTimeInExtremeHighPercentDelta *string `form:"bgm.timeInExtremeHighPercentDelta,omitempty" json:"bgm.timeInExtremeHighPercentDelta,omitempty"` + + // BgmTimeInAnyHighPercentDelta PercentDeltaage of time above 180 mg/dL + BgmTimeInAnyHighPercentDelta *string `form:"bgm.timeInAnyHighPercentDelta,omitempty" json:"bgm.timeInAnyHighPercentDelta,omitempty"` + + // BgmTimeInVeryLowRecordsDelta RecordsDelta below 54 mg/dL + BgmTimeInVeryLowRecordsDelta *string `form:"bgm.timeInVeryLowRecordsDelta,omitempty" json:"bgm.timeInVeryLowRecordsDelta,omitempty"` + + // BgmTimeInAnyLowRecordsDelta RecordsDelta below 70 mg/dL + BgmTimeInAnyLowRecordsDelta *string `form:"bgm.timeInAnyLowRecordsDelta,omitempty" json:"bgm.timeInAnyLowRecordsDelta,omitempty"` + + // BgmTimeInLowRecordsDelta RecordsDelta in range 54-70 mg/dL + BgmTimeInLowRecordsDelta *string `form:"bgm.timeInLowRecordsDelta,omitempty" json:"bgm.timeInLowRecordsDelta,omitempty"` + + // BgmTimeInTargetRecordsDelta RecordsDelta in range 70-180 mg/dL + BgmTimeInTargetRecordsDelta *string `form:"bgm.timeInTargetRecordsDelta,omitempty" json:"bgm.timeInTargetRecordsDelta,omitempty"` + + // BgmTimeInHighRecordsDelta RecordsDelta in range 180-250 mg/dL + BgmTimeInHighRecordsDelta *string `form:"bgm.timeInHighRecordsDelta,omitempty" json:"bgm.timeInHighRecordsDelta,omitempty"` + + // BgmTimeInVeryHighRecordsDelta RecordsDelta above 250 mg/dL + BgmTimeInVeryHighRecordsDelta *string `form:"bgm.timeInVeryHighRecordsDelta,omitempty" json:"bgm.timeInVeryHighRecordsDelta,omitempty"` + + // BgmTimeInAnyHighRecordsDelta RecordsDelta above 180 mg/dL + BgmTimeInAnyHighRecordsDelta *string `form:"bgm.timeInAnyHighRecordsDelta,omitempty" json:"bgm.timeInAnyHighRecordsDelta,omitempty"` + + // BgmAverageDailyRecordsDelta Average recordsDelta per day + BgmAverageDailyRecordsDelta *string `form:"bgm.averageDailyRecordsDelta,omitempty" json:"bgm.averageDailyRecordsDelta,omitempty"` + + // BgmTotalRecordsDelta Total recordsDelta in period + BgmTotalRecordsDelta *string `form:"bgm.totalRecordsDelta,omitempty" json:"bgm.totalRecordsDelta,omitempty"` + // BgmLastUploadDateFrom Inclusive BgmLastUploadDateFrom *time.Time `form:"bgm.lastUploadDateFrom,omitempty" json:"bgm.lastUploadDateFrom,omitempty"` @@ -1970,6 +2206,9 @@ type UpdatePatientJSONRequestBody = Patient // UpdatePatientPermissionsJSONRequestBody defines body for UpdatePatientPermissions for application/json ContentType. type UpdatePatientPermissionsJSONRequestBody = PatientPermissions +// AddServiceAccountJSONRequestBody defines body for AddServiceAccount for application/json ContentType. +type AddServiceAccountJSONRequestBody = AddServiceAccount + // UpdateEHRSettingsJSONRequestBody defines body for UpdateEHRSettings for application/json ContentType. type UpdateEHRSettingsJSONRequestBody = EHRSettings diff --git a/vendor/github.com/tidepool-org/platform/alerts/config.go b/vendor/github.com/tidepool-org/platform/alerts/config.go index 93cbdc975..67f2b1d72 100644 --- a/vendor/github.com/tidepool-org/platform/alerts/config.go +++ b/vendor/github.com/tidepool-org/platform/alerts/config.go @@ -8,6 +8,7 @@ import ( "encoding/json" "time" + "github.com/tidepool-org/platform/data" "github.com/tidepool-org/platform/data/blood/glucose" "github.com/tidepool-org/platform/structure" "github.com/tidepool-org/platform/structure/validator" @@ -27,6 +28,9 @@ type Config struct { // UserID permission to that data. FollowedUserID string `json:"followedUserId" bson:"followedUserId"` + // UploadID identifies the device dataset for which these alerts apply. + UploadID string `json:"uploadId" bson:"uploadId,omitempty"` + Alerts `bson:",inline,omitempty"` } @@ -40,8 +44,9 @@ type Alerts struct { } func (c Config) Validate(validator structure.Validator) { - validator.String("UserID", &c.UserID).Using(user.IDValidator) - validator.String("FollowedUserID", &c.FollowedUserID).Using(user.IDValidator) + validator.String("userID", &c.UserID).Using(user.IDValidator) + validator.String("followedUserID", &c.FollowedUserID).Using(user.IDValidator) + validator.String("uploadID", &c.UploadID).Exists().Using(data.SetIDValidator) c.Alerts.Validate(validator) } diff --git a/vendor/github.com/tidepool-org/platform/data/data.go b/vendor/github.com/tidepool-org/platform/data/data.go index c02cee6f2..476a3cf27 100644 --- a/vendor/github.com/tidepool-org/platform/data/data.go +++ b/vendor/github.com/tidepool-org/platform/data/data.go @@ -3,6 +3,7 @@ package data import ( "regexp" "strconv" + "time" "github.com/tidepool-org/platform/errors" "github.com/tidepool-org/platform/id" @@ -132,3 +133,16 @@ func ErrorValueStringAsIDNotValid(value string) error { } var idExpression = regexp.MustCompile("^[0-9a-z]{32}$") // TODO: Want just "[0-9a-f]{32}" (Jellyfish uses [0-9a-z]) + +// UserDataStatus is used to track the state of the user's data at the start of a summary calculation +type UserDataStatus struct { + FirstData time.Time + LastData time.Time + + EarliestModified time.Time + + LastUpload time.Time + + LastUpdated time.Time + NextLastUpdated time.Time +} diff --git a/vendor/github.com/tidepool-org/platform/data/datum.go b/vendor/github.com/tidepool-org/platform/data/datum.go index c06075ec3..eb7d2d049 100644 --- a/vendor/github.com/tidepool-org/platform/data/datum.go +++ b/vendor/github.com/tidepool-org/platform/data/datum.go @@ -23,6 +23,7 @@ type Datum interface { GetType() string IsActive() bool GetTime() *time.Time + GetUploadID() *string SetUserID(userID *string) SetDataSetID(dataSetID *string) diff --git a/vendor/github.com/tidepool-org/platform/errors/errors.go b/vendor/github.com/tidepool-org/platform/errors/errors.go index 2b0a012d4..ed7431076 100644 --- a/vendor/github.com/tidepool-org/platform/errors/errors.go +++ b/vendor/github.com/tidepool-org/platform/errors/errors.go @@ -615,3 +615,10 @@ func ErrorFromContext(ctx context.Context) error { } return nil } + +func Meta(err error) interface{} { + if objectErr, objectOK := err.(*object); objectOK { + return objectErr.Meta + } + return nil +} diff --git a/vendor/github.com/tidepool-org/platform/request/values_parser.go b/vendor/github.com/tidepool-org/platform/request/values_parser.go index 788981024..a6d576693 100644 --- a/vendor/github.com/tidepool-org/platform/request/values_parser.go +++ b/vendor/github.com/tidepool-org/platform/request/values_parser.go @@ -1,6 +1,7 @@ package request import ( + "encoding/json" "strconv" "strings" "time" @@ -230,6 +231,22 @@ func (v *Values) Array(reference string) *[]interface{} { return nil } +func (v *Values) JSON(reference string, target any) { + rawValue, ok := v.raw(reference) + if !ok { + return + } + + if rawValue == "" { + return + } + + err := json.Unmarshal([]byte(rawValue), target) + if err != nil { + v.base.WithReference(reference).ReportError(structureParser.ErrorTypeNotJSON(rawValue, err)) + } +} + func (v *Values) Interface(reference string) *interface{} { rawValue, ok := v.raw(reference) if !ok { diff --git a/vendor/github.com/tidepool-org/platform/structure/parser.go b/vendor/github.com/tidepool-org/platform/structure/parser.go index b37ef4438..4c21c7c80 100644 --- a/vendor/github.com/tidepool-org/platform/structure/parser.go +++ b/vendor/github.com/tidepool-org/platform/structure/parser.go @@ -27,6 +27,7 @@ type ObjectParser interface { StringArray(reference string) *[]string Time(reference string, layout string) *time.Time ForgivingTime(reference string, layout string) *time.Time + JSON(reference string, target any) Object(reference string) *map[string]interface{} Array(reference string) *[]interface{} diff --git a/vendor/github.com/tidepool-org/platform/structure/parser/errors.go b/vendor/github.com/tidepool-org/platform/structure/parser/errors.go index 75d9cf5b1..c62cbf5c7 100644 --- a/vendor/github.com/tidepool-org/platform/structure/parser/errors.go +++ b/vendor/github.com/tidepool-org/platform/structure/parser/errors.go @@ -10,6 +10,7 @@ const ( ErrorCodeTypeNotTime = "type-not-time" ErrorCodeTypeNotObject = "type-not-object" ErrorCodeTypeNotArray = "type-not-array" + ErrorCodeTypeNotJSON = "type-not-json" ErrorCodeValueNotParsable = "value-not-parsable" ErrorCodeNotParsed = "not-parsed" ) @@ -30,6 +31,10 @@ func ErrorTypeNotString(value interface{}) error { return errors.Preparedf(ErrorCodeTypeNotString, "type is not string", "type is not string, but %T", value) } +func ErrorTypeNotJSON(value interface{}, err error) error { + return errors.Preparedf(ErrorCodeTypeNotJSON, "type is not parsable json", "type is not parsable json, error: %s, original value: %s", err, value) +} + func ErrorTypeNotTime(value interface{}) error { return errors.Preparedf(ErrorCodeTypeNotTime, "type is not time", "type is not time, but %T", value) } diff --git a/vendor/github.com/tidepool-org/platform/structure/parser/object_parser.go b/vendor/github.com/tidepool-org/platform/structure/parser/object_parser.go index 2ac432793..c33a69378 100644 --- a/vendor/github.com/tidepool-org/platform/structure/parser/object_parser.go +++ b/vendor/github.com/tidepool-org/platform/structure/parser/object_parser.go @@ -1,6 +1,7 @@ package parser import ( + "encoding/json" "math" "sort" "time" @@ -278,6 +279,28 @@ func (o *Object) Array(reference string) *[]interface{} { return &arrayValue } +func (o *Object) JSON(reference string, target any) { + rawValue, ok := o.raw(reference) + if !ok { + return + } + + stringValue, ok := rawValue.(string) + if !ok { + o.base.WithReference(reference).ReportError(ErrorTypeNotString(rawValue)) + return + } + + if stringValue == "" { + return + } + + err := json.Unmarshal([]byte(stringValue), target) + if err != nil { + o.base.WithReference(reference).ReportError(ErrorTypeNotJSON(rawValue, err)) + } +} + func (o *Object) Interface(reference string) *interface{} { rawValue, ok := o.raw(reference) if !ok { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go index 7e08aab35..fc4a7b1db 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go @@ -330,7 +330,7 @@ func (DefaultValueDecoders) intDecodeType(dc DecodeContext, vr bsonrw.ValueReade case reflect.Int64: return reflect.ValueOf(i64), nil case reflect.Int: - if int64(int(i64)) != i64 { // Can we fit this inside of an int + if i64 > math.MaxInt { // Can we fit this inside of an int return emptyValue, fmt.Errorf("%d overflows int", i64) } @@ -434,7 +434,7 @@ func (dvd DefaultValueDecoders) UintDecodeValue(dc DecodeContext, vr bsonrw.Valu return fmt.Errorf("%d overflows uint64", i64) } case reflect.Uint: - if i64 < 0 || int64(uint(i64)) != i64 { // Can we fit this inside of an uint + if i64 < 0 || uint64(i64) > uint64(math.MaxUint) { // Can we fit this inside of an uint return fmt.Errorf("%d overflows uint", i64) } default: diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go index 852547276..39b07135b 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go @@ -164,11 +164,15 @@ func (uic *UIntCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t refl return reflect.ValueOf(uint64(i64)), nil case reflect.Uint: - if i64 < 0 || int64(uint(i64)) != i64 { // Can we fit this inside of an uint + if i64 < 0 { + return emptyValue, fmt.Errorf("%d overflows uint", i64) + } + v := uint64(i64) + if v > math.MaxUint { // Can we fit this inside of an uint return emptyValue, fmt.Errorf("%d overflows uint", i64) } - return reflect.ValueOf(uint(i64)), nil + return reflect.ValueOf(uint(v)), nil default: return emptyValue, ValueDecoderError{ Name: "UintDecodeValue", diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go index 969570424..af6ae7b76 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go @@ -95,9 +95,9 @@ func (ejv *extJSONValue) parseBinary() (b []byte, subType byte, err error) { return nil, 0, fmt.Errorf("$binary subType value should be string, but instead is %s", val.t) } - i, err := strconv.ParseInt(val.v.(string), 16, 64) + i, err := strconv.ParseUint(val.v.(string), 16, 8) if err != nil { - return nil, 0, fmt.Errorf("invalid $binary subType string: %s", val.v.(string)) + return nil, 0, fmt.Errorf("invalid $binary subType string: %q: %w", val.v.(string), err) } subType = byte(i) diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go index a242bb57c..0e07d5055 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go @@ -842,7 +842,7 @@ func (vr *valueReader) peekLength() (int32, error) { } idx := vr.offset - return (int32(vr.d[idx]) | int32(vr.d[idx+1])<<8 | int32(vr.d[idx+2])<<16 | int32(vr.d[idx+3])<<24), nil + return int32(binary.LittleEndian.Uint32(vr.d[idx:])), nil } func (vr *valueReader) readLength() (int32, error) { return vr.readi32() } @@ -854,7 +854,7 @@ func (vr *valueReader) readi32() (int32, error) { idx := vr.offset vr.offset += 4 - return (int32(vr.d[idx]) | int32(vr.d[idx+1])<<8 | int32(vr.d[idx+2])<<16 | int32(vr.d[idx+3])<<24), nil + return int32(binary.LittleEndian.Uint32(vr.d[idx:])), nil } func (vr *valueReader) readu32() (uint32, error) { @@ -864,7 +864,7 @@ func (vr *valueReader) readu32() (uint32, error) { idx := vr.offset vr.offset += 4 - return (uint32(vr.d[idx]) | uint32(vr.d[idx+1])<<8 | uint32(vr.d[idx+2])<<16 | uint32(vr.d[idx+3])<<24), nil + return binary.LittleEndian.Uint32(vr.d[idx:]), nil } func (vr *valueReader) readi64() (int64, error) { @@ -874,8 +874,7 @@ func (vr *valueReader) readi64() (int64, error) { idx := vr.offset vr.offset += 8 - return int64(vr.d[idx]) | int64(vr.d[idx+1])<<8 | int64(vr.d[idx+2])<<16 | int64(vr.d[idx+3])<<24 | - int64(vr.d[idx+4])<<32 | int64(vr.d[idx+5])<<40 | int64(vr.d[idx+6])<<48 | int64(vr.d[idx+7])<<56, nil + return int64(binary.LittleEndian.Uint64(vr.d[idx:])), nil } func (vr *valueReader) readu64() (uint64, error) { @@ -885,6 +884,5 @@ func (vr *valueReader) readu64() (uint64, error) { idx := vr.offset vr.offset += 8 - return uint64(vr.d[idx]) | uint64(vr.d[idx+1])<<8 | uint64(vr.d[idx+2])<<16 | uint64(vr.d[idx+3])<<24 | - uint64(vr.d[idx+4])<<32 | uint64(vr.d[idx+5])<<40 | uint64(vr.d[idx+6])<<48 | uint64(vr.d[idx+7])<<56, nil + return binary.LittleEndian.Uint64(vr.d[idx:]), nil } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go b/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go index 4d1bfb316..a8088e1e3 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/raw_value.go @@ -88,8 +88,12 @@ func (rv RawValue) UnmarshalWithRegistry(r *bsoncodec.Registry, val interface{}) return dec.DecodeValue(bsoncodec.DecodeContext{Registry: r}, vr, rval) } -// UnmarshalWithContext performs the same unmarshalling as Unmarshal but uses the provided DecodeContext -// instead of the one attached or the default registry. +// UnmarshalWithContext performs the same unmarshalling as Unmarshal but uses +// the provided DecodeContext instead of the one attached or the default +// registry. +// +// Deprecated: Use [RawValue.UnmarshalWithRegistry] with a custom registry to customize +// unmarshal behavior instead. func (rv RawValue) UnmarshalWithContext(dc *bsoncodec.DecodeContext, val interface{}) error { if dc == nil { return ErrNilContext diff --git a/vendor/go.mongodb.org/mongo-driver/bson/registry.go b/vendor/go.mongodb.org/mongo-driver/bson/registry.go index b5b0f3568..d6afb2850 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/registry.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/registry.go @@ -10,15 +10,27 @@ import ( "go.mongodb.org/mongo-driver/bson/bsoncodec" ) -// DefaultRegistry is the default bsoncodec.Registry. It contains the default codecs and the -// primitive codecs. +// DefaultRegistry is the default bsoncodec.Registry. It contains the default +// codecs and the primitive codecs. +// +// Deprecated: Use [NewRegistry] to construct a new default registry. To use a +// custom registry when marshaling or unmarshaling, use the "SetRegistry" method +// on an [Encoder] or [Decoder] instead: +// +// dec, err := bson.NewDecoder(bsonrw.NewBSONDocumentReader(data)) +// if err != nil { +// panic(err) +// } +// dec.SetRegistry(reg) +// +// See [Encoder] and [Decoder] for more examples. var DefaultRegistry = NewRegistry() // NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and // decoders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the // PrimitiveCodecs type in this package. // -// Deprecated: Use NewRegistry instead. +// Deprecated: Use [NewRegistry] instead. func NewRegistryBuilder() *bsoncodec.RegistryBuilder { rb := bsoncodec.NewRegistryBuilder() bsoncodec.DefaultValueEncoders{}.RegisterDefaultEncoders(rb) diff --git a/vendor/go.mongodb.org/mongo-driver/internal/logger/io_sink.go b/vendor/go.mongodb.org/mongo-driver/internal/logger/io_sink.go index c5ff1474b..0a6c1bdca 100644 --- a/vendor/go.mongodb.org/mongo-driver/internal/logger/io_sink.go +++ b/vendor/go.mongodb.org/mongo-driver/internal/logger/io_sink.go @@ -9,6 +9,7 @@ package logger import ( "encoding/json" "io" + "math" "sync" "time" ) @@ -36,7 +37,11 @@ func NewIOSink(out io.Writer) *IOSink { // Info will write a JSON-encoded message to the io.Writer. func (sink *IOSink) Info(_ int, msg string, keysAndValues ...interface{}) { - kvMap := make(map[string]interface{}, len(keysAndValues)/2+2) + mapSize := len(keysAndValues) / 2 + if math.MaxInt-mapSize >= 2 { + mapSize += 2 + } + kvMap := make(map[string]interface{}, mapSize) kvMap[KeyTimestamp] = time.Now().UnixNano() kvMap[KeyMessage] = msg diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/change_stream.go b/vendor/go.mongodb.org/mongo-driver/mongo/change_stream.go index 1bedcc3f8..8d0a2031d 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/change_stream.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/change_stream.go @@ -531,6 +531,12 @@ func (cs *ChangeStream) ID() int64 { return cs.cursor.ID() } +// RemainingBatchLength returns the number of documents left in the current batch. If this returns zero, the subsequent +// call to Next or TryNext will do a network request to fetch the next batch. +func (cs *ChangeStream) RemainingBatchLength() int { + return len(cs.batch) +} + // SetBatchSize sets the number of documents to fetch from the database with // each iteration of the ChangeStream's "Next" or "TryNext" method. This setting // only affects subsequent document batches fetched from the database. diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/client.go b/vendor/go.mongodb.org/mongo-driver/mongo/client.go index 280749c7d..4266412aa 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/client.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/client.go @@ -209,10 +209,6 @@ func NewClient(opts ...*options.ClientOptions) (*Client, error) { clientOpt.SetMaxPoolSize(defaultMaxPoolSize) } - if err != nil { - return nil, err - } - cfg, err := topology.NewConfig(clientOpt, client.clock) if err != nil { return nil, err diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/collection.go b/vendor/go.mongodb.org/mongo-driver/mongo/collection.go index 555035ff5..4cf6fd1a1 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/collection.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/collection.go @@ -1200,6 +1200,11 @@ func (coll *Collection) Distinct(ctx context.Context, fieldName string, filter i // For more information about the command, see https://www.mongodb.com/docs/manual/reference/command/find/. func (coll *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (cur *Cursor, err error) { + + if ctx == nil { + ctx = context.Background() + } + // Omit "maxTimeMS" from operations that return a user-managed cursor to // prevent confusing "cursor not found" errors. To maintain existing // behavior for users who set "timeoutMS" with no context deadline, only @@ -1217,10 +1222,6 @@ func (coll *Collection) find( opts ...*options.FindOptions, ) (cur *Cursor, err error) { - if ctx == nil { - ctx = context.Background() - } - f, err := marshal(filter, coll.bsonOpts, coll.registry) if err != nil { return nil, err @@ -1801,8 +1802,11 @@ func (coll *Collection) Indexes() IndexView { // SearchIndexes returns a SearchIndexView instance that can be used to perform operations on the search indexes for the collection. func (coll *Collection) SearchIndexes() SearchIndexView { + c, _ := coll.Clone() // Clone() always return a nil error. + c.readConcern = nil + c.writeConcern = nil return SearchIndexView{ - coll: coll, + coll: c, } } diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/database.go b/vendor/go.mongodb.org/mongo-driver/mongo/database.go index c5cda9e5b..57c0186ec 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/database.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/database.go @@ -580,7 +580,7 @@ func (db *Database) getEncryptedFieldsFromServer(ctx context.Context, collection return encryptedFields, nil } -// getEncryptedFieldsFromServer tries to get an "encryptedFields" document associated with collectionName by checking the client EncryptedFieldsMap. +// getEncryptedFieldsFromMap tries to get an "encryptedFields" document associated with collectionName by checking the client EncryptedFieldsMap. // Returns nil and no error if an EncryptedFieldsMap is not configured, or does not contain an entry for collectionName. func (db *Database) getEncryptedFieldsFromMap(collectionName string) interface{} { // Check the EncryptedFieldsMap diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go index db5674591..17b373130 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go @@ -15,6 +15,7 @@ import ( "errors" "fmt" "io/ioutil" + "math" "net" "net/http" "strings" @@ -1177,7 +1178,19 @@ func addClientCertFromSeparateFiles(cfg *tls.Config, keyFile, certFile, keyPassw return "", err } - data := make([]byte, 0, len(keyData)+len(certData)+1) + keySize := len(keyData) + if keySize > 64*1024*1024 { + return "", errors.New("X.509 key must be less than 64 MiB") + } + certSize := len(certData) + if certSize > 64*1024*1024 { + return "", errors.New("X.509 certificate must be less than 64 MiB") + } + dataSize := keySize + certSize + 1 + if dataSize > math.MaxInt { + return "", errors.New("size overflow") + } + data := make([]byte, 0, dataSize) data = append(data, keyData...) data = append(data, '\n') data = append(data, certData...) diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/mongooptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/mongooptions.go index fd17ce44e..36088c2fc 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/mongooptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/mongooptions.go @@ -104,7 +104,7 @@ const ( // UpdateLookup includes a delta describing the changes to the document and a copy of the entire document that // was changed. UpdateLookup FullDocument = "updateLookup" - // WhenAvailable includes a post-image of the the modified document for replace and update change events + // WhenAvailable includes a post-image of the modified document for replace and update change events // if the post-image for this event is available. WhenAvailable FullDocument = "whenAvailable" ) diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/options/searchindexoptions.go b/vendor/go.mongodb.org/mongo-driver/mongo/options/searchindexoptions.go index 9774d615b..8cb8a08b7 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/options/searchindexoptions.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/options/searchindexoptions.go @@ -9,6 +9,7 @@ package options // SearchIndexesOptions represents options that can be used to configure a SearchIndexView. type SearchIndexesOptions struct { Name *string + Type *string } // SearchIndexes creates a new SearchIndexesOptions instance. @@ -22,6 +23,12 @@ func (sio *SearchIndexesOptions) SetName(name string) *SearchIndexesOptions { return sio } +// SetType sets the value for the Type field. +func (sio *SearchIndexesOptions) SetType(typ string) *SearchIndexesOptions { + sio.Type = &typ + return sio +} + // CreateSearchIndexesOptions represents options that can be used to configure a SearchIndexView.CreateOne or // SearchIndexView.CreateMany operation. type CreateSearchIndexesOptions struct { diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/search_index_view.go b/vendor/go.mongodb.org/mongo-driver/mongo/search_index_view.go index 6a7871531..73fe8534e 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/search_index_view.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/search_index_view.go @@ -13,7 +13,6 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo/options" - "go.mongodb.org/mongo-driver/mongo/writeconcern" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/operation" @@ -109,6 +108,9 @@ func (siv SearchIndexView) CreateMany( if model.Options != nil && model.Options.Name != nil { indexes = bsoncore.AppendStringElement(indexes, "name", *model.Options.Name) } + if model.Options != nil && model.Options.Type != nil { + indexes = bsoncore.AppendStringElement(indexes, "type", *model.Options.Type) + } indexes = bsoncore.AppendDocumentElement(indexes, "definition", definition) indexes, err = bsoncore.AppendDocumentEnd(indexes, iidx) @@ -134,20 +136,13 @@ func (siv SearchIndexView) CreateMany( return nil, err } - wc := siv.coll.writeConcern - if sess.TransactionRunning() { - wc = nil - } - if !writeconcern.AckWrite(wc) { - sess = nil - } - selector := makePinnedSelector(sess, siv.coll.writeSelector) op := operation.NewCreateSearchIndexes(indexes). - Session(sess).WriteConcern(wc).ClusterClock(siv.coll.client.clock). - Database(siv.coll.db.name).Collection(siv.coll.name).CommandMonitor(siv.coll.client.monitor). - Deployment(siv.coll.client.deployment).ServerSelector(selector).ServerAPI(siv.coll.client.serverAPI). + Session(sess).CommandMonitor(siv.coll.client.monitor). + ServerSelector(selector).ClusterClock(siv.coll.client.clock). + Collection(siv.coll.name).Database(siv.coll.db.name). + Deployment(siv.coll.client.deployment).ServerAPI(siv.coll.client.serverAPI). Timeout(siv.coll.client.timeout) err = op.Execute(ctx) @@ -196,20 +191,12 @@ func (siv SearchIndexView) DropOne( return err } - wc := siv.coll.writeConcern - if sess.TransactionRunning() { - wc = nil - } - if !writeconcern.AckWrite(wc) { - sess = nil - } - selector := makePinnedSelector(sess, siv.coll.writeSelector) op := operation.NewDropSearchIndex(name). - Session(sess).WriteConcern(wc).CommandMonitor(siv.coll.client.monitor). + Session(sess).CommandMonitor(siv.coll.client.monitor). ServerSelector(selector).ClusterClock(siv.coll.client.clock). - Database(siv.coll.db.name).Collection(siv.coll.name). + Collection(siv.coll.name).Database(siv.coll.db.name). Deployment(siv.coll.client.deployment).ServerAPI(siv.coll.client.serverAPI). Timeout(siv.coll.client.timeout) @@ -258,20 +245,12 @@ func (siv SearchIndexView) UpdateOne( return err } - wc := siv.coll.writeConcern - if sess.TransactionRunning() { - wc = nil - } - if !writeconcern.AckWrite(wc) { - sess = nil - } - selector := makePinnedSelector(sess, siv.coll.writeSelector) op := operation.NewUpdateSearchIndex(name, indexDefinition). - Session(sess).WriteConcern(wc).CommandMonitor(siv.coll.client.monitor). + Session(sess).CommandMonitor(siv.coll.client.monitor). ServerSelector(selector).ClusterClock(siv.coll.client.clock). - Database(siv.coll.db.name).Collection(siv.coll.name). + Collection(siv.coll.name).Database(siv.coll.db.name). Deployment(siv.coll.client.deployment).ServerAPI(siv.coll.client.serverAPI). Timeout(siv.coll.client.timeout) diff --git a/vendor/go.mongodb.org/mongo-driver/mongo/writeconcern/writeconcern.go b/vendor/go.mongodb.org/mongo-driver/mongo/writeconcern/writeconcern.go index 1d9472ec0..7a73d8d72 100644 --- a/vendor/go.mongodb.org/mongo-driver/mongo/writeconcern/writeconcern.go +++ b/vendor/go.mongodb.org/mongo-driver/mongo/writeconcern/writeconcern.go @@ -51,7 +51,7 @@ var ErrNegativeWTimeout = errors.New("write concern `wtimeout` field cannot be n type WriteConcern struct { // W requests acknowledgment that the write operation has propagated to a // specified number of mongod instances or to mongod instances with - // specified tags. It sets the the "w" option in a MongoDB write concern. + // specified tags. It sets the "w" option in a MongoDB write concern. // // W values must be a string or an int. // diff --git a/vendor/go.mongodb.org/mongo-driver/version/version.go b/vendor/go.mongodb.org/mongo-driver/version/version.go index 879bbdb7a..659d48d7a 100644 --- a/vendor/go.mongodb.org/mongo-driver/version/version.go +++ b/vendor/go.mongodb.org/mongo-driver/version/version.go @@ -8,4 +8,4 @@ package version // import "go.mongodb.org/mongo-driver/version" // Driver is the current version of the driver. -var Driver = "v1.15.0" +var Driver = "1.16.0" diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go index 88133293e..03925d7ad 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go @@ -8,6 +8,7 @@ package bsoncore // import "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" import ( "bytes" + "encoding/binary" "fmt" "math" "strconv" @@ -706,17 +707,16 @@ func ReserveLength(dst []byte) (int32, []byte) { // UpdateLength updates the length at index with length and returns the []byte. func UpdateLength(dst []byte, index, length int32) []byte { - dst[index] = byte(length) - dst[index+1] = byte(length >> 8) - dst[index+2] = byte(length >> 16) - dst[index+3] = byte(length >> 24) + binary.LittleEndian.PutUint32(dst[index:], uint32(length)) return dst } func appendLength(dst []byte, l int32) []byte { return appendi32(dst, l) } func appendi32(dst []byte, i32 int32) []byte { - return append(dst, byte(i32), byte(i32>>8), byte(i32>>16), byte(i32>>24)) + b := []byte{0, 0, 0, 0} + binary.LittleEndian.PutUint32(b, uint32(i32)) + return append(dst, b...) } // ReadLength reads an int32 length from src and returns the length and the remaining bytes. If @@ -734,27 +734,26 @@ func readi32(src []byte) (int32, []byte, bool) { if len(src) < 4 { return 0, src, false } - return (int32(src[0]) | int32(src[1])<<8 | int32(src[2])<<16 | int32(src[3])<<24), src[4:], true + return int32(binary.LittleEndian.Uint32(src)), src[4:], true } func appendi64(dst []byte, i64 int64) []byte { - return append(dst, - byte(i64), byte(i64>>8), byte(i64>>16), byte(i64>>24), - byte(i64>>32), byte(i64>>40), byte(i64>>48), byte(i64>>56), - ) + b := []byte{0, 0, 0, 0, 0, 0, 0, 0} + binary.LittleEndian.PutUint64(b, uint64(i64)) + return append(dst, b...) } func readi64(src []byte) (int64, []byte, bool) { if len(src) < 8 { return 0, src, false } - i64 := (int64(src[0]) | int64(src[1])<<8 | int64(src[2])<<16 | int64(src[3])<<24 | - int64(src[4])<<32 | int64(src[5])<<40 | int64(src[6])<<48 | int64(src[7])<<56) - return i64, src[8:], true + return int64(binary.LittleEndian.Uint64(src)), src[8:], true } func appendu32(dst []byte, u32 uint32) []byte { - return append(dst, byte(u32), byte(u32>>8), byte(u32>>16), byte(u32>>24)) + b := []byte{0, 0, 0, 0} + binary.LittleEndian.PutUint32(b, u32) + return append(dst, b...) } func readu32(src []byte) (uint32, []byte, bool) { @@ -762,23 +761,20 @@ func readu32(src []byte) (uint32, []byte, bool) { return 0, src, false } - return (uint32(src[0]) | uint32(src[1])<<8 | uint32(src[2])<<16 | uint32(src[3])<<24), src[4:], true + return binary.LittleEndian.Uint32(src), src[4:], true } func appendu64(dst []byte, u64 uint64) []byte { - return append(dst, - byte(u64), byte(u64>>8), byte(u64>>16), byte(u64>>24), - byte(u64>>32), byte(u64>>40), byte(u64>>48), byte(u64>>56), - ) + b := []byte{0, 0, 0, 0, 0, 0, 0, 0} + binary.LittleEndian.PutUint64(b, u64) + return append(dst, b...) } func readu64(src []byte) (uint64, []byte, bool) { if len(src) < 8 { return 0, src, false } - u64 := (uint64(src[0]) | uint64(src[1])<<8 | uint64(src[2])<<16 | uint64(src[3])<<24 | - uint64(src[4])<<32 | uint64(src[5])<<40 | uint64(src[6])<<48 | uint64(src[7])<<56) - return u64, src[8:], true + return binary.LittleEndian.Uint64(src), src[8:], true } // keep in sync with readcstringbytes diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go index 6837b53fc..f68e1da1a 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/doc.go @@ -4,10 +4,18 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Package bsoncore contains functions that can be used to encode and decode BSON -// elements and values to or from a slice of bytes. These functions are aimed at -// allowing low level manipulation of BSON and can be used to build a higher -// level BSON library. +// Package bsoncore is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! +// +// Package bsoncore contains functions that can be used to encode and decode +// BSON elements and values to or from a slice of bytes. These functions are +// aimed at allowing low level manipulation of BSON and can be used to build a +// higher level BSON library. // // The Read* functions within this package return the values of the element and // a boolean indicating if the values are valid. A boolean was used instead of @@ -15,15 +23,12 @@ // enough bytes. This library attempts to do no validation, it will only return // false if there are not enough bytes for an item to be read. For example, the // ReadDocument function checks the length, if that length is larger than the -// number of bytes available, it will return false, if there are enough bytes, it -// will return those bytes and true. It is the consumers responsibility to +// number of bytes available, it will return false, if there are enough bytes, +// it will return those bytes and true. It is the consumers responsibility to // validate those bytes. // // The Append* functions within this package will append the type value to the // given dst slice. If the slice has enough capacity, it will not grow the // slice. The Append*Element functions within this package operate in the same // way, but additionally append the BSON type and the key before the value. -// -// Warning: Package bsoncore is unstable and there is no backward compatibility -// guarantee. It is experimental and subject to change. package bsoncore diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/DESIGN.md b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/DESIGN.md deleted file mode 100644 index 3c3e6c56c..000000000 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/DESIGN.md +++ /dev/null @@ -1,27 +0,0 @@ -# Driver Library Design - -This document outlines the design for this package. - -## Deployment, Server, and Connection - -Acquiring a `Connection` from a `Server` selected from a `Deployment` enables sending and receiving -wire messages. A `Deployment` represents an set of MongoDB servers and a `Server` represents a -member of that set. These three types form the operation execution stack. - -### Compression - -Compression is handled by Connection type while uncompression is handled automatically by the -Operation type. This is done because the compressor to use for compressing a wire message is -chosen by the connection during handshake, while uncompression can be performed without this -information. This does make the design of compression non-symmetric, but it makes the design simpler -to implement and more consistent. - -## Operation - -The `Operation` type handles executing a series of commands using a `Deployment`. For most uses -`Operation` will only execute a single command, but the main use case for a series of commands is -batch split write commands, such as insert. The type itself is heavily documented, so reading the -code and comments together should provide an understanding of how the type works. - -This type is not meant to be used directly by callers. Instead a wrapping type should be defined -using the IDL. diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/creds/doc.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/creds/doc.go new file mode 100644 index 000000000..99c4c3470 --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/creds/doc.go @@ -0,0 +1,14 @@ +// Copyright (C) MongoDB, Inc. 2024-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package creds is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! +package creds diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/doc.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/doc.go index 9db65cf19..5f9f1f574 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/doc.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/doc.go @@ -4,20 +4,11 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Package auth is not for public use. +// Package auth is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. // -// The API for packages in the 'private' directory have no stability -// guarantee. -// -// The packages within the 'private' directory would normally be put into an -// 'internal' directory to prohibit their use outside the 'mongo' directory. -// However, some MongoDB tools require very low-level access to the building -// blocks of a driver, so we have placed them under 'private' to allow these -// packages to be imported by projects that need them. -// -// These package APIs may be modified in backwards-incompatible ways at any -// time. -// -// You are strongly discouraged from directly using any packages -// under 'private'. +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package auth diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/compression.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/compression.go index d79b024b7..d9a6c68fe 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/compression.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/compression.go @@ -30,7 +30,11 @@ type CompressionOpts struct { // destination writer. It panics on any errors and should only be used at // package initialization time. func mustZstdNewWriter(lvl zstd.EncoderLevel) *zstd.Encoder { - enc, err := zstd.NewWriter(nil, zstd.WithEncoderLevel(lvl)) + enc, err := zstd.NewWriter( + nil, + zstd.WithWindowSize(8<<20), // Set window size to 8MB. + zstd.WithEncoderLevel(lvl), + ) if err != nil { panic(err) } @@ -105,6 +109,13 @@ func (e *zlibEncoder) Encode(dst, src []byte) ([]byte, error) { return dst, nil } +var zstdBufPool = sync.Pool{ + New: func() interface{} { + s := make([]byte, 0) + return &s + }, +} + // CompressPayload takes a byte slice and compresses it according to the options passed func CompressPayload(in []byte, opts CompressionOpts) ([]byte, error) { switch opts.Compressor { @@ -123,7 +134,13 @@ func CompressPayload(in []byte, opts CompressionOpts) ([]byte, error) { if err != nil { return nil, err } - return encoder.EncodeAll(in, nil), nil + ptr := zstdBufPool.Get().(*[]byte) + b := encoder.EncodeAll(in, *ptr) + dst := make([]byte, len(b)) + copy(dst, b) + *ptr = b[:0] + zstdBufPool.Put(ptr) + return dst, nil default: return nil, fmt.Errorf("unknown compressor ID %v", opts.Compressor) } diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/connstring/connstring.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/connstring/connstring.go index 52068b8ea..686458e29 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/connstring/connstring.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/connstring/connstring.go @@ -4,6 +4,13 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Package connstring is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package connstring // import "go.mongodb.org/mongo-driver/x/mongo/driver/connstring" import ( diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/dns/dns.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/dns/dns.go index 6573a4c1a..9334d493e 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/dns/dns.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/dns/dns.go @@ -4,6 +4,13 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Package dns is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package dns import ( diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/driver.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/driver.go index 5fd3ddcb4..900729bf8 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/driver.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/driver.go @@ -4,6 +4,13 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Package driver is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package driver // import "go.mongodb.org/mongo-driver/x/mongo/driver" import ( diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/mongocrypt_not_enabled.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/mongocrypt_not_enabled.go index 24f9f9b0e..80f500085 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/mongocrypt_not_enabled.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/mongocrypt_not_enabled.go @@ -7,6 +7,13 @@ //go:build !cse // +build !cse +// Package mongocrypt is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package mongocrypt import ( diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/options/doc.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/options/doc.go new file mode 100644 index 000000000..e0cc77052 --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt/options/doc.go @@ -0,0 +1,14 @@ +// Copyright (C) MongoDB, Inc. 2024-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package options is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! +package options diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/ocsp.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/ocsp.go index 870072872..2bff94a65 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/ocsp.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/ocsp/ocsp.go @@ -4,6 +4,13 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Package ocsp is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package ocsp import ( diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go index eb1acec88..db5367bed 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation.go @@ -622,7 +622,7 @@ func (op Operation) Execute(ctx context.Context) error { } }() for { - // If we're starting a retry and the the error from the previous try was + // If we're starting a retry and the error from the previous try was // a context canceled or deadline exceeded error, stop retrying and // return that error. if errors.Is(prevErr, context.Canceled) || errors.Is(prevErr, context.DeadlineExceeded) { @@ -1574,11 +1574,17 @@ func (op Operation) addClusterTime(dst []byte, desc description.SelectedServer) // operation's MaxTimeMS if set. If no MaxTimeMS is set on the operation, and context is // not a Timeout context, calculateMaxTimeMS returns 0. func (op Operation) calculateMaxTimeMS(ctx context.Context, mon RTTMonitor) (uint64, error) { - if csot.IsTimeoutContext(ctx) { - if op.OmitCSOTMaxTimeMS { - return 0, nil - } - + // If CSOT is enabled and we're not omitting the CSOT-calculated maxTimeMS + // value, then calculate maxTimeMS. + // + // This allows commands that do not currently send CSOT-calculated maxTimeMS + // (e.g. Find and Aggregate) to still use a manually-provided maxTimeMS + // value. + // + // TODO(GODRIVER-2944): Remove or refactor this logic when we add the + // "timeoutMode" option, which will allow users to opt-in to the + // CSOT-calculated maxTimeMS values if that's the behavior they want. + if csot.IsTimeoutContext(ctx) && !op.OmitCSOTMaxTimeMS { if deadline, ok := ctx.Deadline(); ok { remainingTimeout := time.Until(deadline) rtt90 := mon.P90() @@ -1893,7 +1899,6 @@ func (op Operation) decodeResult(ctx context.Context, opcode wiremessage.OpCode, return nil, errors.New("malformed wire message: insufficient bytes to read single document") } case wiremessage.DocumentSequence: - // TODO(GODRIVER-617): Implement document sequence returns. _, _, wm, ok = wiremessage.ReadMsgSectionDocumentSequence(wm) if !ok { return nil, errors.New("malformed wire message: insufficient bytes to read document sequence") @@ -1989,7 +1994,7 @@ func (op Operation) publishStartedEvent(ctx context.Context, info startedInforma } } -// canPublishSucceededEvent returns true if a CommandSucceededEvent can be +// canPublishFinishedEvent returns true if a CommandSucceededEvent can be // published for the given command. This is true if the command is not an // unacknowledged write and the command monitor is monitoring succeeded events. func (op Operation) canPublishFinishedEvent(info finishedInformation) bool { diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/create_search_indexes.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/create_search_indexes.go index a16f9d716..cb0d80795 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/create_search_indexes.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/create_search_indexes.go @@ -15,7 +15,6 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/event" "go.mongodb.org/mongo-driver/mongo/description" - "go.mongodb.org/mongo-driver/mongo/writeconcern" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/session" @@ -23,19 +22,18 @@ import ( // CreateSearchIndexes performs a createSearchIndexes operation. type CreateSearchIndexes struct { - indexes bsoncore.Document - session *session.Client - clock *session.ClusterClock - collection string - monitor *event.CommandMonitor - crypt driver.Crypt - database string - deployment driver.Deployment - selector description.ServerSelector - writeConcern *writeconcern.WriteConcern - result CreateSearchIndexesResult - serverAPI *driver.ServerAPIOptions - timeout *time.Duration + indexes bsoncore.Document + session *session.Client + clock *session.ClusterClock + collection string + monitor *event.CommandMonitor + crypt driver.Crypt + database string + deployment driver.Deployment + selector description.ServerSelector + result CreateSearchIndexesResult + serverAPI *driver.ServerAPIOptions + timeout *time.Duration } // CreateSearchIndexResult represents a single search index result in CreateSearchIndexesResult. @@ -109,9 +107,15 @@ func (csi *CreateSearchIndexes) Execute(ctx context.Context) error { return driver.Operation{ CommandFn: csi.command, ProcessResponseFn: csi.processResponse, + Client: csi.session, + Clock: csi.clock, CommandMonitor: csi.monitor, + Crypt: csi.crypt, Database: csi.database, Deployment: csi.deployment, + Selector: csi.selector, + ServerAPI: csi.serverAPI, + Timeout: csi.timeout, }.Execute(ctx) } @@ -214,16 +218,6 @@ func (csi *CreateSearchIndexes) ServerSelector(selector description.ServerSelect return csi } -// WriteConcern sets the write concern for this operation. -func (csi *CreateSearchIndexes) WriteConcern(writeConcern *writeconcern.WriteConcern) *CreateSearchIndexes { - if csi == nil { - csi = new(CreateSearchIndexes) - } - - csi.writeConcern = writeConcern - return csi -} - // ServerAPI sets the server API version for this operation. func (csi *CreateSearchIndexes) ServerAPI(serverAPI *driver.ServerAPIOptions) *CreateSearchIndexes { if csi == nil { diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/doc.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/doc.go new file mode 100644 index 000000000..e55b12a74 --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/doc.go @@ -0,0 +1,14 @@ +// Copyright (C) MongoDB, Inc. 2024-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package operation is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! +package operation diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_search_index.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_search_index.go index 25cde8154..3992c8316 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_search_index.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_search_index.go @@ -14,7 +14,6 @@ import ( "go.mongodb.org/mongo-driver/event" "go.mongodb.org/mongo-driver/mongo/description" - "go.mongodb.org/mongo-driver/mongo/writeconcern" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/session" @@ -22,19 +21,18 @@ import ( // DropSearchIndex performs an dropSearchIndex operation. type DropSearchIndex struct { - index string - session *session.Client - clock *session.ClusterClock - collection string - monitor *event.CommandMonitor - crypt driver.Crypt - database string - deployment driver.Deployment - selector description.ServerSelector - writeConcern *writeconcern.WriteConcern - result DropSearchIndexResult - serverAPI *driver.ServerAPIOptions - timeout *time.Duration + index string + session *session.Client + clock *session.ClusterClock + collection string + monitor *event.CommandMonitor + crypt driver.Crypt + database string + deployment driver.Deployment + selector description.ServerSelector + result DropSearchIndexResult + serverAPI *driver.ServerAPIOptions + timeout *time.Duration } // DropSearchIndexResult represents a dropSearchIndex result returned by the server. @@ -93,7 +91,6 @@ func (dsi *DropSearchIndex) Execute(ctx context.Context) error { Database: dsi.database, Deployment: dsi.deployment, Selector: dsi.selector, - WriteConcern: dsi.writeConcern, ServerAPI: dsi.serverAPI, Timeout: dsi.timeout, }.Execute(ctx) @@ -196,16 +193,6 @@ func (dsi *DropSearchIndex) ServerSelector(selector description.ServerSelector) return dsi } -// WriteConcern sets the write concern for this operation. -func (dsi *DropSearchIndex) WriteConcern(writeConcern *writeconcern.WriteConcern) *DropSearchIndex { - if dsi == nil { - dsi = new(DropSearchIndex) - } - - dsi.writeConcern = writeConcern - return dsi -} - // ServerAPI sets the server API version for this operation. func (dsi *DropSearchIndex) ServerAPI(serverAPI *driver.ServerAPIOptions) *DropSearchIndex { if dsi == nil { diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update_search_index.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update_search_index.go index ba807986c..64f2da7f6 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update_search_index.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update_search_index.go @@ -14,7 +14,6 @@ import ( "go.mongodb.org/mongo-driver/event" "go.mongodb.org/mongo-driver/mongo/description" - "go.mongodb.org/mongo-driver/mongo/writeconcern" "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" "go.mongodb.org/mongo-driver/x/mongo/driver" "go.mongodb.org/mongo-driver/x/mongo/driver/session" @@ -22,20 +21,19 @@ import ( // UpdateSearchIndex performs a updateSearchIndex operation. type UpdateSearchIndex struct { - index string - definition bsoncore.Document - session *session.Client - clock *session.ClusterClock - collection string - monitor *event.CommandMonitor - crypt driver.Crypt - database string - deployment driver.Deployment - selector description.ServerSelector - writeConcern *writeconcern.WriteConcern - result UpdateSearchIndexResult - serverAPI *driver.ServerAPIOptions - timeout *time.Duration + index string + definition bsoncore.Document + session *session.Client + clock *session.ClusterClock + collection string + monitor *event.CommandMonitor + crypt driver.Crypt + database string + deployment driver.Deployment + selector description.ServerSelector + result UpdateSearchIndexResult + serverAPI *driver.ServerAPIOptions + timeout *time.Duration } // UpdateSearchIndexResult represents a single index in the updateSearchIndexResult result. @@ -95,7 +93,6 @@ func (usi *UpdateSearchIndex) Execute(ctx context.Context) error { Database: usi.database, Deployment: usi.deployment, Selector: usi.selector, - WriteConcern: usi.writeConcern, ServerAPI: usi.serverAPI, Timeout: usi.timeout, }.Execute(ctx) @@ -209,16 +206,6 @@ func (usi *UpdateSearchIndex) ServerSelector(selector description.ServerSelector return usi } -// WriteConcern sets the write concern for this operation. -func (usi *UpdateSearchIndex) WriteConcern(writeConcern *writeconcern.WriteConcern) *UpdateSearchIndex { - if usi == nil { - usi = new(UpdateSearchIndex) - } - - usi.writeConcern = writeConcern - return usi -} - // ServerAPI sets the server API version for this operation. func (usi *UpdateSearchIndex) ServerAPI(serverAPI *driver.ServerAPIOptions) *UpdateSearchIndex { if usi == nil { diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/session/doc.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/session/doc.go new file mode 100644 index 000000000..80b2ac2dd --- /dev/null +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/session/doc.go @@ -0,0 +1,14 @@ +// Copyright (C) MongoDB, Inc. 2024-present. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package session is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! +package session diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection.go index 476459e8e..649e87b3d 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection.go @@ -320,7 +320,7 @@ func transformNetworkError(ctx context.Context, originalError error, contextDead // If there was an error and the context was cancelled, we assume it happened due to the cancellation. if errors.Is(ctx.Err(), context.Canceled) { - return context.Canceled + return ctx.Err() } // If there was a timeout error and the context deadline was used, we convert the error into @@ -329,7 +329,7 @@ func transformNetworkError(ctx context.Context, originalError error, contextDead return originalError } if netErr, ok := originalError.(net.Error); ok && netErr.Timeout() { - return context.DeadlineExceeded + return fmt.Errorf("%w: %s", context.DeadlineExceeded, originalError.Error()) } return originalError diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/rtt_monitor.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/rtt_monitor.go index 07f508caa..c7b168dc2 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/rtt_monitor.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/rtt_monitor.go @@ -56,7 +56,6 @@ type rttMonitor struct { cfg *rttConfig ctx context.Context cancelFn context.CancelFunc - started bool } var _ driver.RTTMonitor = &rttMonitor{} @@ -83,7 +82,6 @@ func (r *rttMonitor) connect() { r.connMu.Lock() defer r.connMu.Unlock() - r.started = true r.closeWg.Add(1) go func() { @@ -97,10 +95,6 @@ func (r *rttMonitor) disconnect() { r.connMu.Lock() defer r.connMu.Unlock() - if !r.started { - return - } - r.cancelFn() // Wait for the existing connection to complete. diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/server.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/server.go index f4c6d744a..99f8dd618 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/server.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/server.go @@ -125,6 +125,7 @@ type Server struct { processErrorLock sync.Mutex rttMonitor *rttMonitor + monitorOnce sync.Once } // updateTopologyCallback is a callback used to create a server that should be called when the parent Topology instance @@ -285,10 +286,10 @@ func (s *Server) Disconnect(ctx context.Context) error { close(s.done) s.cancelCheck() - s.rttMonitor.disconnect() s.pool.close(ctx) s.closewg.Wait() + s.rttMonitor.disconnect() atomic.StoreInt64(&s.state, serverDisconnected) return nil @@ -661,8 +662,8 @@ func (s *Server) update() { transitionedFromNetworkError := desc.LastError != nil && unwrapConnectionError(desc.LastError) != nil && previousDescription.Kind != description.Unknown - if isStreamingEnabled(s) && isStreamable(s) && !s.rttMonitor.started { - s.rttMonitor.connect() + if isStreamingEnabled(s) && isStreamable(s) { + s.monitorOnce.Do(s.rttMonitor.connect) } if isStreamable(s) || connectionIsStreaming || transitionedFromNetworkError { diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/topology.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/topology.go index 3dbbcfb86..0fb913d21 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/topology.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/topology.go @@ -4,10 +4,19 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -// Package topology contains types that handles the discovery, monitoring, and selection -// of servers. This package is designed to expose enough inner workings of service discovery -// and monitoring to allow low level applications to have fine grained control, while hiding -// most of the detailed implementation of the algorithms. +// Package topology is intended for internal use only. It is made available to +// facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! +// +// Package topology contains types that handles the discovery, monitoring, and +// selection of servers. This package is designed to expose enough inner +// workings of service discovery and monitoring to allow low level applications +// to have fine grained control, while hiding most of the detailed +// implementation of the algorithms. package topology // import "go.mongodb.org/mongo-driver/x/mongo/driver/topology" import ( diff --git a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage/wiremessage.go b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage/wiremessage.go index abf09c15b..2199f855b 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage/wiremessage.go +++ b/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/wiremessage/wiremessage.go @@ -4,10 +4,18 @@ // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +// Package wiremessage is intended for internal use only. It is made available +// to facilitate use cases that require access to internal MongoDB driver +// functionality and state. The API of this package is not stable and there is +// no backward compatibility guarantee. +// +// WARNING: THIS PACKAGE IS EXPERIMENTAL AND MAY BE MODIFIED OR REMOVED WITHOUT +// NOTICE! USE WITH EXTREME CAUTION! package wiremessage import ( "bytes" + "encoding/binary" "strings" "sync/atomic" @@ -231,10 +239,11 @@ func ReadHeader(src []byte) (length, requestID, responseTo int32, opcode OpCode, if len(src) < 16 { return 0, 0, 0, 0, src, false } - length = (int32(src[0]) | int32(src[1])<<8 | int32(src[2])<<16 | int32(src[3])<<24) - requestID = (int32(src[4]) | int32(src[5])<<8 | int32(src[6])<<16 | int32(src[7])<<24) - responseTo = (int32(src[8]) | int32(src[9])<<8 | int32(src[10])<<16 | int32(src[11])<<24) - opcode = OpCode(int32(src[12]) | int32(src[13])<<8 | int32(src[14])<<16 | int32(src[15])<<24) + + length = readi32unsafe(src) + requestID = readi32unsafe(src[4:]) + responseTo = readi32unsafe(src[8:]) + opcode = OpCode(readi32unsafe(src[12:])) return length, requestID, responseTo, opcode, src[16:], true } @@ -486,7 +495,7 @@ func ReadReplyCursorID(src []byte) (cursorID int64, rem []byte, ok bool) { return readi64(src) } -// ReadReplyStartingFrom reads the starting from from src. +// ReadReplyStartingFrom reads the starting from src. func ReadReplyStartingFrom(src []byte) (startingFrom int32, rem []byte, ok bool) { return readi32(src) } @@ -570,12 +579,16 @@ func ReadKillCursorsCursorIDs(src []byte, numIDs int32) (cursorIDs []int64, rem return cursorIDs, src, true } -func appendi32(dst []byte, i32 int32) []byte { - return append(dst, byte(i32), byte(i32>>8), byte(i32>>16), byte(i32>>24)) +func appendi32(dst []byte, x int32) []byte { + b := []byte{0, 0, 0, 0} + binary.LittleEndian.PutUint32(b, uint32(x)) + return append(dst, b...) } -func appendi64(b []byte, i int64) []byte { - return append(b, byte(i), byte(i>>8), byte(i>>16), byte(i>>24), byte(i>>32), byte(i>>40), byte(i>>48), byte(i>>56)) +func appendi64(dst []byte, x int64) []byte { + b := []byte{0, 0, 0, 0, 0, 0, 0, 0} + binary.LittleEndian.PutUint64(b, uint64(x)) + return append(dst, b...) } func appendCString(b []byte, str string) []byte { @@ -587,21 +600,18 @@ func readi32(src []byte) (int32, []byte, bool) { if len(src) < 4 { return 0, src, false } - - return (int32(src[0]) | int32(src[1])<<8 | int32(src[2])<<16 | int32(src[3])<<24), src[4:], true + return readi32unsafe(src), src[4:], true } func readi32unsafe(src []byte) int32 { - return (int32(src[0]) | int32(src[1])<<8 | int32(src[2])<<16 | int32(src[3])<<24) + return int32(binary.LittleEndian.Uint32(src)) } func readi64(src []byte) (int64, []byte, bool) { if len(src) < 8 { return 0, src, false } - i64 := (int64(src[0]) | int64(src[1])<<8 | int64(src[2])<<16 | int64(src[3])<<24 | - int64(src[4])<<32 | int64(src[5])<<40 | int64(src[6])<<48 | int64(src[7])<<56) - return i64, src[8:], true + return int64(binary.LittleEndian.Uint64(src)), src[8:], true } func readcstring(src []byte) (string, []byte, bool) { diff --git a/vendor/go.uber.org/fx/CHANGELOG.md b/vendor/go.uber.org/fx/CHANGELOG.md index 1d7286f18..08642a59a 100644 --- a/vendor/go.uber.org/fx/CHANGELOG.md +++ b/vendor/go.uber.org/fx/CHANGELOG.md @@ -10,6 +10,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.22.1](https://github.com/uber-go/fx/compare/v1.22.0...v1.22.1) - 2024-06-25 + +### Fixed +- Fx apps will only listen to signals when `.Run()`, `.Wait()`, or `.Done()` + are called, fixing a regression introduced in v1.19.0. + ## [1.22.0](https://github.com/uber-go/fx/compare/v1.21.1...v1.22.0) - 2024-05-30 ### Added diff --git a/vendor/go.uber.org/fx/app.go b/vendor/go.uber.org/fx/app.go index 8189f9d71..ef3d35a0d 100644 --- a/vendor/go.uber.org/fx/app.go +++ b/vendor/go.uber.org/fx/app.go @@ -704,7 +704,6 @@ func (app *App) start(ctx context.Context) error { if err := app.lifecycle.Start(ctx); err != nil { return err } - app.receivers.Start(ctx) return nil }) } @@ -742,6 +741,7 @@ func (app *App) Stop(ctx context.Context) (err error) { // Alternatively, a signal can be broadcast to all done channels manually by // using the Shutdown functionality (see the [Shutdowner] documentation for details). func (app *App) Done() <-chan os.Signal { + app.receivers.Start() // No-op if running return app.receivers.Done() } @@ -752,6 +752,7 @@ func (app *App) Done() <-chan os.Signal { // in the [ShutdownSignal] struct. // Otherwise, the signal that was received will be set. func (app *App) Wait() <-chan ShutdownSignal { + app.receivers.Start() // No-op if running return app.receivers.Wait() } diff --git a/vendor/go.uber.org/fx/signal.go b/vendor/go.uber.org/fx/signal.go index 1b8456899..595a847bc 100644 --- a/vendor/go.uber.org/fx/signal.go +++ b/vendor/go.uber.org/fx/signal.go @@ -102,7 +102,7 @@ func (recv *signalReceivers) running() bool { return recv.shutdown != nil && recv.finished != nil } -func (recv *signalReceivers) Start(ctx context.Context) { +func (recv *signalReceivers) Start() { recv.m.Lock() defer recv.m.Unlock() diff --git a/vendor/go.uber.org/fx/version.go b/vendor/go.uber.org/fx/version.go index 130cb33f7..9ca711601 100644 --- a/vendor/go.uber.org/fx/version.go +++ b/vendor/go.uber.org/fx/version.go @@ -21,4 +21,4 @@ package fx // Version is exported for runtime compatibility checks. -const Version = "1.22.0" +const Version = "1.22.1" diff --git a/vendor/modules.txt b/vendor/modules.txt index 8632e284a..595c330fe 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,3 @@ -## workspace # github.com/IBM/sarama v1.43.2 ## explicit; go 1.19 github.com/IBM/sarama @@ -12,7 +11,7 @@ github.com/apapsch/go-jsonmerge/v2 # github.com/avast/retry-go v3.0.0+incompatible ## explicit github.com/avast/retry-go -# github.com/aws/aws-sdk-go v1.54.0 +# github.com/aws/aws-sdk-go v1.54.11 ## explicit; go 1.19 github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/auth/bearer @@ -101,13 +100,9 @@ github.com/globalsign/mgo/internal/scram # github.com/golang/mock v1.6.0 ## explicit; go 1.11 github.com/golang/mock/gomock -# github.com/golang/protobuf v1.5.4 -## explicit; go 1.17 # github.com/golang/snappy v0.0.4 ## explicit github.com/golang/snappy -# github.com/google/uuid v1.5.0 -## explicit # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid @@ -215,7 +210,7 @@ github.com/pkg/errors # github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 ## explicit github.com/rcrowley/go-metrics -# github.com/tidepool-org/clinic/client v0.0.0-20240612205715-a4a56080b4f7 +# github.com/tidepool-org/clinic/client v0.0.0-20240629034458-1365c8963143 ## explicit; go 1.22 github.com/tidepool-org/clinic/client # github.com/tidepool-org/go-common v0.12.2-0.20240612192926-de6d5c5a742c @@ -230,7 +225,7 @@ github.com/tidepool-org/go-common/clients/status github.com/tidepool-org/go-common/errors github.com/tidepool-org/go-common/events github.com/tidepool-org/go-common/jepson -# github.com/tidepool-org/platform v1.33.1-0.20240412022409-2d52339c4886 +# github.com/tidepool-org/platform v1.33.1-0.20240710040908-039dbee20943 ## explicit; go 1.22 github.com/tidepool-org/platform/alerts github.com/tidepool-org/platform/auth @@ -281,7 +276,7 @@ github.com/xdg/stringprep # github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 ## explicit; go 1.22 github.com/youmark/pkcs8 -# go.mongodb.org/mongo-driver v1.15.0 +# go.mongodb.org/mongo-driver v1.16.0 ## explicit; go 1.18 go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/bson/bsoncodec @@ -337,7 +332,7 @@ go.uber.org/dig/internal/digerror go.uber.org/dig/internal/digreflect go.uber.org/dig/internal/dot go.uber.org/dig/internal/graph -# go.uber.org/fx v1.22.0 +# go.uber.org/fx v1.22.1 ## explicit; go 1.20 go.uber.org/fx go.uber.org/fx/fxevent @@ -386,7 +381,3 @@ golang.org/x/sys/windows ## explicit; go 1.18 golang.org/x/text/transform golang.org/x/text/unicode/norm -# google.golang.org/appengine v1.6.8 -## explicit; go 1.11 -# google.golang.org/protobuf v1.34.2 -## explicit; go 1.20