diff --git a/docs/data-sources/collection.md b/docs/data-sources/collection.md index 4e30f4e..81282a9 100644 --- a/docs/data-sources/collection.md +++ b/docs/data-sources/collection.md @@ -60,4 +60,3 @@ data "pinecone_collection" "test" { - `id` (String) Collection identifier - `size` (Number) The size of the collection in bytes. - `status` (String) The status of the collection. -- `vector_count` (Number) The number of records stored in the collection. diff --git a/docs/data-sources/collections.md b/docs/data-sources/collections.md index bd1ac95..0e166d5 100644 --- a/docs/data-sources/collections.md +++ b/docs/data-sources/collections.md @@ -44,7 +44,6 @@ data "pinecone_collections" "test" { Required: - `name` (String) The name of the collection. -- `source` (String) The name of the source index to be used as the source for the collection. Read-Only: @@ -52,4 +51,3 @@ Read-Only: - `environment` (String) The environment where the collection is hosted. - `size` (Number) The size of the collection in bytes. - `status` (String) The status of the collection. -- `vector_count` (Number) The number of records stored in the collection. diff --git a/docs/index.md b/docs/index.md index 42b6e9d..2e914c1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,4 +33,3 @@ provider "pinecone" { ### Optional - `api_key` (String, Sensitive) Pinecone API Key. Can be configured by setting PINECONE_API_KEY environment variable. -- `environment` (String) Pinecone Environment. Can be configured by setting PINECONE_ENVIRONMENT environment variable. diff --git a/docs/resources/collection.md b/docs/resources/collection.md index 65f27a5..446db28 100644 --- a/docs/resources/collection.md +++ b/docs/resources/collection.md @@ -61,7 +61,6 @@ resource "pinecone_collection" "test" { - `id` (String) Collection identifier - `size` (Number) The size of the collection in bytes. - `status` (String) The status of the collection. -- `vector_count` (Number) The number of records stored in the collection. ### Nested Schema for `timeouts` diff --git a/go.mod b/go.mod index 8b1a479..486b363 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,13 @@ go 1.21.1 require ( github.com/hashicorp/terraform-plugin-docs v0.18.0 - github.com/hashicorp/terraform-plugin-framework v1.5.0 + github.com/hashicorp/terraform-plugin-framework v1.7.0 github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.21.0 - github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 + github.com/hashicorp/terraform-plugin-go v0.22.1 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/hashicorp/terraform-plugin-testing v1.6.0 - github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240218063037-dc2384fe1625 + github.com/pinecone-io/go-pinecone v0.4.0 ) require ( @@ -19,16 +18,18 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect + github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect github.com/agext/levenshtein v1.2.2 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect + github.com/deepmap/oapi-codegen/v2 v2.1.0 // indirect github.com/fatih/color v1.16.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/cli v1.1.6 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect @@ -39,11 +40,12 @@ require ( github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/hc-install v0.6.2 // indirect + github.com/hashicorp/hc-install v0.6.3 // indirect github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.20.0 // indirect github.com/hashicorp/terraform-json v0.21.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect @@ -57,29 +59,30 @@ require ( github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/oapi-codegen/runtime v1.1.1 // indirect github.com/oklog/run v1.1.0 // indirect github.com/posener/complete v1.2.3 // indirect github.com/russross/blackfriday v1.6.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/yuin/goldmark v1.6.0 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect github.com/zclconf/go-cty v1.14.2 // indirect - golang.org/x/crypto v0.19.0 // indirect + golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/grpc v1.61.1 // indirect - google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect + google.golang.org/grpc v1.62.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) // Use below for local development diff --git a/go.sum b/go.sum index 4adebc9..99ca7b9 100644 --- a/go.sum +++ b/go.sum @@ -10,10 +10,13 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= +github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= @@ -21,10 +24,9 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= @@ -32,6 +34,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deepmap/oapi-codegen/v2 v2.1.0 h1:I/NMVhJCtuvL9x+S2QzZKpSjGi33oDZwPRdemvOZWyQ= +github.com/deepmap/oapi-codegen/v2 v2.1.0/go.mod h1:R1wL226vc5VmCNJUvMyYr3hJMm5reyv25j952zAVXZ8= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -43,8 +47,8 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= -github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg= +github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= +github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -52,15 +56,15 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4er github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/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/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 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/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/hashicorp/cli v1.1.6 h1:CMOV+/LJfL1tXCOKrgAX0uRKnzjj/mpmqNXloRSy2K8= github.com/hashicorp/cli v1.1.6/go.mod h1:MPon5QYlgjjo0BSoAiN0ESeT5fRzDjVRp+uioJ0piz4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -73,8 +77,6 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -87,8 +89,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U3mw/M= -github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps= +github.com/hashicorp/hc-install v0.6.3 h1:yE/r1yJvWbtrJ0STwScgEnCanb0U9v7zp0Gbkmcoxqs= +github.com/hashicorp/hc-install v0.6.3/go.mod h1:KamGdbodYzlufbWh4r9NRo8y6GLHWZP2GBtdnms1Ln0= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= @@ -99,18 +101,18 @@ github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRy github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= github.com/hashicorp/terraform-plugin-docs v0.18.0 h1:2bINhzXc+yDeAcafurshCrIjtdu1XHn9zZ3ISuEhgpk= github.com/hashicorp/terraform-plugin-docs v0.18.0/go.mod h1:iIUfaJpdUmpi+rI42Kgq+63jAjI8aZVTyxp3Bvk9Hg8= -github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= -github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= +github.com/hashicorp/terraform-plugin-framework v1.7.0 h1:wOULbVmfONnJo9iq7/q+iBOBJul5vRovaYJIu2cY/Pw= +github.com/hashicorp/terraform-plugin-framework v1.7.0/go.mod h1:jY9Id+3KbZ17OMpulgnWLSfwxNVYSoYBQFTgsx044CI= github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E= github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= -github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= +github.com/hashicorp/terraform-plugin-go v0.22.1 h1:iTS7WHNVrn7uhe3cojtvWWn83cm2Z6ryIUDTRO0EV7w= +github.com/hashicorp/terraform-plugin-go v0.22.1/go.mod h1:qrjnqRghvQ6KnDbB12XeZ4FluclYwptntoWCr9QaXTI= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= github.com/hashicorp/terraform-plugin-testing v1.6.0 h1:Wsnfh+7XSVRfwcr2jZYHsnLOnZl7UeaOBvsx6dl/608= github.com/hashicorp/terraform-plugin-testing v1.6.0/go.mod h1:cJGG0/8j9XhHaJZRC+0sXFI4uzqQZ9Az4vh6C4GJpFE= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= @@ -128,6 +130,7 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -162,8 +165,12 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +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/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/pinecone-io/go-pinecone v0.4.0 h1:9ByZ26X3HrvvR08rbNMigtSe0uNjPDaw3UpCfYKPNM4= +github.com/pinecone-io/go-pinecone v0.4.0/go.mod h1:KwWSueZFx9zccC+thBk13+LDiOgii8cff9bliUI4tQs= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -181,21 +188,13 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20230915100420-d738153b7db6 h1:lNxddu2jA+2FvJ3lL9mF4XkKGHJCJbMVsyAMEtwUTF0= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20230915100420-d738153b7db6/go.mod h1:d/aDpnWSD8QTYvUKniJ+RjuXMvBfg1Uu28P2rWbi4WM= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240215003141-b2d2b7cbfc23 h1:usvV0CuwqIUmjEfW3hecVOW0a7lT1kAq1zHpPDazptg= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240215003141-b2d2b7cbfc23/go.mod h1:d/aDpnWSD8QTYvUKniJ+RjuXMvBfg1Uu28P2rWbi4WM= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240217112828-0beacfac5475 h1:L4hMTgWVp6X6bzRUYTYn5OeILnluMMnzM4HkuCQ4SRE= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240217112828-0beacfac5475/go.mod h1:d/aDpnWSD8QTYvUKniJ+RjuXMvBfg1Uu28P2rWbi4WM= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240218024056-d377aa60667d h1:yigom7B5hV94OvTIWWcvVHu1vJetO+kQkrJ6XlqYL0o= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240218024056-d377aa60667d/go.mod h1:d/aDpnWSD8QTYvUKniJ+RjuXMvBfg1Uu28P2rWbi4WM= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240218063037-dc2384fe1625 h1:kPt77eaKLhtOwOVPABxHzUWx3TOP1ihAhp9etggcoZo= -github.com/skyscrapr/pinecone-sdk-go v0.0.0-20240218063037-dc2384fe1625/go.mod h1:d/aDpnWSD8QTYvUKniJ+RjuXMvBfg1Uu28P2rWbi4WM= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= @@ -220,33 +219,23 @@ github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgr golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/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-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -259,35 +248,25 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -295,25 +274,24 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= -google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa h1:Jt1XW5PaLXF1/ePZrznsh/aAUvI7Adfc3LY1dAKlzRs= +google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:K4kfzHtI0kqWA79gecJarFtDn/Mls+GxQcg3Zox91Ac= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa h1:RBgMaUMP+6soRkik4VoN8ojR2nex2TqZwjSSogic+eo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pinecone/models/collections.go b/pinecone/models/collections.go index ec0d859..867d693 100644 --- a/pinecone/models/collections.go +++ b/pinecone/models/collections.go @@ -6,16 +6,16 @@ package models import ( "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" ) // CollectionModel describes the collection data model. type CollectionModel struct { - Name types.String `tfsdk:"name"` - Size types.Int64 `tfsdk:"size"` - Status types.String `tfsdk:"status"` - Dimension types.Int64 `tfsdk:"dimension"` - VectorCount types.Int64 `tfsdk:"vector_count"` + Name types.String `tfsdk:"name"` + Size types.Int64 `tfsdk:"size"` + Status types.String `tfsdk:"status"` + Dimension types.Int64 `tfsdk:"dimension"` + // VectorCount types.Int64 `tfsdk:"vector_count"` Environment types.String `tfsdk:"environment"` } @@ -23,12 +23,15 @@ func NewCollectionModel(collection *pinecone.Collection) *CollectionModel { if collection != nil { newCollection := &CollectionModel{ Name: types.StringValue(collection.Name), - Size: types.Int64Value(int64(collection.Size)), - Status: types.StringValue(collection.Status), - Dimension: types.Int64Value(int64(collection.Dimension)), - VectorCount: types.Int64Value(int64(collection.VectorCount)), + Status: types.StringValue(string(collection.Status)), Environment: types.StringValue(collection.Environment), } + if collection.Size != nil { + newCollection.Size = types.Int64Value(*collection.Size) + } + if collection.Dimension != nil { + newCollection.Dimension = types.Int64Value(int64(*collection.Dimension)) + } return newCollection } return nil @@ -36,11 +39,11 @@ func NewCollectionModel(collection *pinecone.Collection) *CollectionModel { // CollectionResourceModel describes the resource data model. type CollectionResourceModel struct { - Name types.String `tfsdk:"name"` - Size types.Int64 `tfsdk:"size"` - Status types.String `tfsdk:"status"` - Dimension types.Int64 `tfsdk:"dimension"` - VectorCount types.Int64 `tfsdk:"vector_count"` + Name types.String `tfsdk:"name"` + Size types.Int64 `tfsdk:"size"` + Status types.String `tfsdk:"status"` + Dimension types.Int64 `tfsdk:"dimension"` + // VectorCount types.Int64 `tfsdk:"vector_count"` Environment types.String `tfsdk:"environment"` Id types.String `tfsdk:"id"` Source types.String `tfsdk:"source"` @@ -51,20 +54,29 @@ func (model *CollectionResourceModel) Read(collection *pinecone.Collection) { model.Id = types.StringValue(collection.Name) model.Name = types.StringValue(collection.Name) model.Source = types.StringValue(model.Source.ValueString()) - model.Size = types.Int64Value(int64(collection.Size)) - model.Status = types.StringValue(collection.Status) - model.Dimension = types.Int64Value(int64(collection.Dimension)) - model.VectorCount = types.Int64Value(int64(collection.VectorCount)) + model.Status = types.StringValue(string(collection.Status)) model.Environment = types.StringValue(collection.Environment) + if collection.Size != nil { + model.Size = types.Int64Value(*collection.Size) + } + if collection.Dimension != nil { + model.Dimension = types.Int64Value(int64(*collection.Dimension)) + } + // var vectorCount *int64 + // if collection.VectorCount != nil { + // tempVectorCount := int64(*collection.VectorCount) + // vectorCount = &tempVectorCount + // } + // model.VectorCount = types.Int64PointerValue(vectorCount) } // CollectionDataSourceModel describes the data source data model. type CollectionDataSourceModel struct { - Name types.String `tfsdk:"name"` - Size types.Int64 `tfsdk:"size"` - Status types.String `tfsdk:"status"` - Dimension types.Int64 `tfsdk:"dimension"` - VectorCount types.Int64 `tfsdk:"vector_count"` + Name types.String `tfsdk:"name"` + Size types.Int64 `tfsdk:"size"` + Status types.String `tfsdk:"status"` + Dimension types.Int64 `tfsdk:"dimension"` + // VectorCount types.Int64 `tfsdk:"vector_count"` Environment types.String `tfsdk:"environment"` Id types.String `tfsdk:"id"` } @@ -72,11 +84,15 @@ type CollectionDataSourceModel struct { func (model *CollectionDataSourceModel) Read(collection *pinecone.Collection) { model.Id = types.StringValue(collection.Name) model.Name = types.StringValue(collection.Name) - model.Size = types.Int64Value(int64(collection.Size)) - model.Status = types.StringValue(collection.Status) - model.Dimension = types.Int64Value(int64(collection.Dimension)) - model.VectorCount = types.Int64Value(int64(collection.VectorCount)) + model.Status = types.StringValue(string(collection.Status)) model.Environment = types.StringValue(collection.Environment) + if collection.Size != nil { + model.Size = types.Int64Value(*collection.Size) + } + if collection.Dimension != nil { + model.Dimension = types.Int64Value(int64(*collection.Dimension)) + } + // model.VectorCount = types.Int64Value(int64(*collection.VectorCount)) } // CollectionsDataSourceModel describes the data source data model. diff --git a/pinecone/models/indexes.go b/pinecone/models/indexes.go index 3c4b734..2c010aa 100644 --- a/pinecone/models/indexes.go +++ b/pinecone/models/indexes.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" ) type IndexModel struct { @@ -28,7 +28,7 @@ func (model *IndexModel) Read(ctx context.Context, index *pinecone.Index) diag.D model.Name = types.StringValue(index.Name) model.Dimension = types.Int64Value(int64(index.Dimension)) - model.Metric = types.StringValue(index.Metric.String()) + model.Metric = types.StringValue(string(index.Metric)) model.Host = types.StringValue(index.Host) pod, diags := NewIndexPodSpecModel(ctx, index.Spec.Pod) @@ -47,7 +47,7 @@ func (model *IndexModel) Read(ctx context.Context, index *pinecone.Index) diag.D model.Status, diags = types.ObjectValueFrom(ctx, IndexStatusModel{}.AttrTypes(), IndexStatusModel{ Ready: types.BoolValue(index.Status.Ready), - State: types.StringValue(index.Status.State.String()), + State: types.StringValue(string(index.Status.State)), }) if diags.HasError() { return diags @@ -74,7 +74,7 @@ func (model *IndexResourceModel) Read(ctx context.Context, index *pinecone.Index model.Id = types.StringValue(index.Name) model.Name = types.StringValue(index.Name) model.Dimension = types.Int64Value(int64(index.Dimension)) - model.Metric = types.StringValue(index.Metric.String()) + model.Metric = types.StringValue(string(index.Metric)) model.Host = types.StringValue(index.Host) pod, diags := NewIndexPodSpecModel(ctx, index.Spec.Pod) @@ -93,7 +93,7 @@ func (model *IndexResourceModel) Read(ctx context.Context, index *pinecone.Index model.Status, diags = types.ObjectValueFrom(ctx, IndexStatusModel{}.AttrTypes(), IndexStatusModel{ Ready: types.BoolValue(index.Status.Ready), - State: types.StringValue(index.Status.State.String()), + State: types.StringValue(string(index.Status.State)), }) if diags.HasError() { return diags @@ -119,7 +119,7 @@ func (model *IndexDatasourceModel) Read(ctx context.Context, index *pinecone.Ind model.Id = types.StringValue(index.Name) model.Name = types.StringValue(index.Name) model.Dimension = types.Int64Value(int64(index.Dimension)) - model.Metric = types.StringValue(index.Metric.String()) + model.Metric = types.StringValue(string(index.Metric)) model.Host = types.StringValue(index.Host) pod, diags := NewIndexPodSpecModel(ctx, index.Spec.Pod) @@ -138,7 +138,7 @@ func (model *IndexDatasourceModel) Read(ctx context.Context, index *pinecone.Ind model.Status, diags = types.ObjectValueFrom(ctx, IndexStatusModel{}.AttrTypes(), IndexStatusModel{ Ready: types.BoolValue(index.Status.Ready), - State: types.StringValue(index.Status.State.String()), + State: types.StringValue(string(index.Status.State)), }) if diags.HasError() { return diags @@ -162,50 +162,60 @@ func (model IndexSpecModel) AttrTypes() map[string]attr.Type { type IndexPodSpecModel struct { Environment types.String `tfsdk:"environment"` Replicas types.Int64 `tfsdk:"replicas"` - Shards types.Int64 `tfsdk:"shards"` + ShardCount types.Int64 `tfsdk:"shards"` PodType types.String `tfsdk:"pod_type"` - Pods types.Int64 `tfsdk:"pods"` + PodCount types.Int64 `tfsdk:"pods"` MetadataConfig types.Object `tfsdk:"metadata_config"` SourceCollection types.String `tfsdk:"source_collection"` } -func NewIndexPodSpec(ctx context.Context, spec *IndexPodSpecModel) (*pinecone.IndexPodSpec, diag.Diagnostics) { +func NewIndexPodSpec(ctx context.Context, spec *IndexPodSpecModel) (*pinecone.PodSpec, diag.Diagnostics) { if spec != nil { - newSpec := &pinecone.IndexPodSpec{ + newSpec := &pinecone.PodSpec{ Environment: spec.Environment.ValueString(), - Pods: int(spec.Pods.ValueInt64()), + PodCount: int32(spec.PodCount.ValueInt64()), PodType: spec.PodType.ValueString(), - Replicas: int(spec.Replicas.ValueInt64()), - Shards: int(spec.Shards.ValueInt64()), + Replicas: int32(spec.Replicas.ValueInt64()), + ShardCount: int32(spec.ShardCount.ValueInt64()), } - var metadataConfig pinecone.IndexMetadataConfig + var metadataConfig pinecone.PodSpecMetadataConfig if !spec.MetadataConfig.IsUnknown() { diags := spec.MetadataConfig.As(ctx, &metadataConfig, basetypes.ObjectAsOptions{}) if diags.HasError() { return nil, diags } } - newSpec.MetadataConfig = metadataConfig + newSpec.MetadataConfig = &metadataConfig return newSpec, nil } return nil, nil } -func NewIndexPodSpecModel(ctx context.Context, spec *pinecone.IndexPodSpec) (*IndexPodSpecModel, diag.Diagnostics) { +func NewIndexPodSpecModel(ctx context.Context, spec *pinecone.PodSpec) (*IndexPodSpecModel, diag.Diagnostics) { + var diags diag.Diagnostics + if spec != nil { newSpec := &IndexPodSpecModel{ - Environment: types.StringValue(spec.Environment), - Pods: types.Int64Value(int64(spec.Pods)), - PodType: types.StringValue(spec.PodType), - Replicas: types.Int64Value(int64(spec.Replicas)), - Shards: types.Int64Value(int64(spec.Shards)), - SourceCollection: types.StringValue(spec.SourceCollection), + Environment: types.StringValue(spec.Environment), + PodCount: types.Int64Value(int64(spec.PodCount)), + PodType: types.StringValue(spec.PodType), + Replicas: types.Int64Value(int64(spec.Replicas)), + ShardCount: types.Int64Value(int64(spec.ShardCount)), } - indexed, diags := types.ListValueFrom(ctx, types.StringType, spec.MetadataConfig.Indexed) - if diags.HasError() { - return nil, diags + if spec.SourceCollection != nil { + newSpec.SourceCollection = types.StringPointerValue(spec.SourceCollection) + } + + var indexed basetypes.ListValue + if spec.MetadataConfig != nil { + indexed, diags = types.ListValueFrom(ctx, types.StringType, spec.MetadataConfig.Indexed) + if diags.HasError() { + return nil, diags + } + } else { + indexed = types.ListNull(types.StringType) } metadataConfig := &IndexMetadataConfigModel{ Indexed: indexed, @@ -214,7 +224,7 @@ func NewIndexPodSpecModel(ctx context.Context, spec *pinecone.IndexPodSpec) (*In if diags.HasError() { return nil, diags } - return newSpec, diags + return newSpec, nil } return nil, nil } @@ -246,20 +256,20 @@ type IndexServerlessSpecModel struct { Region types.String `tfsdk:"region"` } -func NewIndexServerlessSpec(spec *IndexServerlessSpecModel) *pinecone.IndexServerlessSpec { +func NewIndexServerlessSpec(spec *IndexServerlessSpecModel) *pinecone.ServerlessSpec { if spec != nil { - return &pinecone.IndexServerlessSpec{ - Cloud: spec.Cloud.ValueString(), + return &pinecone.ServerlessSpec{ + Cloud: pinecone.Cloud(spec.Cloud.String()), Region: spec.Region.ValueString(), } } return nil } -func NewIndexServerlessSpecModel(spec *pinecone.IndexServerlessSpec) *IndexServerlessSpecModel { +func NewIndexServerlessSpecModel(spec *pinecone.ServerlessSpec) *IndexServerlessSpecModel { if spec != nil { return &IndexServerlessSpecModel{ - Cloud: types.StringValue(spec.Cloud), + Cloud: types.StringValue(string(spec.Cloud)), Region: types.StringValue(spec.Region), } } diff --git a/pinecone/provider/collection_data_source.go b/pinecone/provider/collection_data_source.go index bdc76d7..ddc7811 100644 --- a/pinecone/provider/collection_data_source.go +++ b/pinecone/provider/collection_data_source.go @@ -54,10 +54,10 @@ func (d *CollectionDataSource) Schema(ctx context.Context, req datasource.Schema MarkdownDescription: "The dimension of the vectors stored in each record held in the collection.", Computed: true, }, - "vector_count": schema.Int64Attribute{ - MarkdownDescription: "The number of records stored in the collection.", - Computed: true, - }, + // "vector_count": schema.Int64Attribute{ + // MarkdownDescription: "The number of records stored in the collection.", + // Computed: true, + // }, "environment": schema.StringAttribute{ MarkdownDescription: "The environment where the collection is hosted.", Computed: true, @@ -76,7 +76,7 @@ func (d *CollectionDataSource) Read(ctx context.Context, req datasource.ReadRequ return } - collection, err := d.client.Collections().DescribeCollection(data.Name.ValueString()) + collection, err := d.client.DescribeCollection(ctx, data.Name.ValueString()) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to describe collection, got error: %s", err)) return diff --git a/pinecone/provider/collection_data_source_test.go b/pinecone/provider/collection_data_source_test.go index 4c6d73c..5ab9a5e 100644 --- a/pinecone/provider/collection_data_source_test.go +++ b/pinecone/provider/collection_data_source_test.go @@ -4,12 +4,12 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccCollectionDataSource(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -23,7 +23,7 @@ func TestAccCollectionDataSource(t *testing.T) { resource.TestCheckResourceAttr("data.pinecone_collection.test", "status", "Ready"), resource.TestCheckResourceAttr("data.pinecone_collection.test", "dimension", "1536"), resource.TestCheckResourceAttrSet("data.pinecone_collection.test", "size"), - resource.TestCheckResourceAttrSet("data.pinecone_collection.test", "vector_count"), + // resource.TestCheckResourceAttrSet("data.pinecone_collection.test", "vector_count"), ), }, }, @@ -33,7 +33,6 @@ func TestAccCollectionDataSource(t *testing.T) { func testAccCollectionDataSourceConfig(name string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { diff --git a/pinecone/provider/collection_resource.go b/pinecone/provider/collection_resource.go index 72eab19..46d2d83 100644 --- a/pinecone/provider/collection_resource.go +++ b/pinecone/provider/collection_resource.go @@ -6,6 +6,7 @@ package provider import ( "context" "fmt" + "strings" "time" "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" @@ -13,9 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" "github.com/skyscrapr/terraform-provider-pinecone/pinecone/models" ) @@ -69,10 +69,11 @@ func (r *CollectionResource) Schema(ctx context.Context, req resource.SchemaRequ MarkdownDescription: "The dimension of the vectors stored in each record held in the collection.", Computed: true, }, - "vector_count": schema.Int64Attribute{ - MarkdownDescription: "The number of records stored in the collection.", - Computed: true, - }, + // "vector_count": schema.Int64Attribute{ + // MarkdownDescription: "The number of records stored in the collection.", + // Optional: true, + // Computed: true, + // }, "environment": schema.StringAttribute{ MarkdownDescription: "The environment where the collection is hosted.", Computed: true, @@ -102,12 +103,12 @@ func (r *CollectionResource) Create(ctx context.Context, req resource.CreateRequ return } - payload := pinecone.CreateCollectionParams{ + payload := pinecone.CreateCollectionRequest{ Name: data.Name.ValueString(), Source: data.Source.ValueString(), } - err := r.client.Collections().CreateCollection(&payload) + _, err := r.client.CreateCollection(ctx, &payload) if err != nil { resp.Diagnostics.AddError("Failed to create collection", err.Error()) return @@ -123,7 +124,7 @@ func (r *CollectionResource) Create(ctx context.Context, req resource.CreateRequ } err = retry.RetryContext(ctx, createTimeout, func() *retry.RetryError { - collection, err := r.client.Collections().DescribeCollection(data.Name.ValueString()) + collection, err := r.client.DescribeCollection(ctx, data.Name.ValueString()) data.Read(collection) // Save current status to state @@ -142,6 +143,8 @@ func (r *CollectionResource) Create(ctx context.Context, req resource.CreateRequ return } + // data.Read(collection) + // Save data into Terraform state resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -153,7 +156,7 @@ func (r *CollectionResource) Read(ctx context.Context, req resource.ReadRequest, return } - collection, err := r.client.Collections().DescribeCollection(data.Id.ValueString()) + collection, err := r.client.DescribeCollection(ctx, data.Id.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to describe collection", err.Error()) return @@ -176,7 +179,7 @@ func (r *CollectionResource) Delete(ctx context.Context, req resource.DeleteRequ return } - err := r.client.Collections().DeleteCollection(data.Name.ValueString()) + err := r.client.DeleteCollection(ctx, data.Name.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to delete collection", err.Error()) return @@ -184,18 +187,18 @@ func (r *CollectionResource) Delete(ctx context.Context, req resource.DeleteRequ // Wait for collection to be deleted // Create() is passed a default timeout to use if no value // has been supplied in the Terraform configuration. - deleteTimeout, diags := data.Timeouts.Create(ctx, defaultIndexDeleteTimeout) + deleteTimeout, diags := data.Timeouts.Delete(ctx, defaultIndexDeleteTimeout) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return } err = retry.RetryContext(ctx, deleteTimeout, func() *retry.RetryError { - collection, err := r.client.Collections().DescribeCollection(data.Id.ValueString()) - tflog.Info(ctx, fmt.Sprintf("Deleting Collection. Status: '%s'", collection.Status)) + collection, err := r.client.DescribeCollection(ctx, data.Id.ValueString()) + // tflog.Info(ctx, fmt.Sprintf("Deleting Collection. Status: '%s'", collection.Status)) if err != nil { - if pineconeErr, ok := err.(*pinecone.HTTPError); ok && pineconeErr.StatusCode == 404 { + if strings.Contains(err.Error(), "404") { return nil } return retry.NonRetryableError(err) diff --git a/pinecone/provider/collection_resource_test.go b/pinecone/provider/collection_resource_test.go index a96028a..f835c0c 100644 --- a/pinecone/provider/collection_resource_test.go +++ b/pinecone/provider/collection_resource_test.go @@ -5,13 +5,13 @@ package provider import ( "fmt" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "testing" ) func TestAccCollectionResource(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -48,7 +48,6 @@ func TestAccCollectionResource(t *testing.T) { func testAccCollectionResourceConfig(name string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { diff --git a/pinecone/provider/collections_data_source.go b/pinecone/provider/collections_data_source.go index 4c23535..4a7f637 100644 --- a/pinecone/provider/collections_data_source.go +++ b/pinecone/provider/collections_data_source.go @@ -46,10 +46,6 @@ func (d *CollectionsDataSource) Schema(ctx context.Context, req datasource.Schem MarkdownDescription: "The name of the collection.", Required: true, }, - "source": schema.StringAttribute{ - MarkdownDescription: "The name of the source index to be used as the source for the collection.", - Required: true, - }, "size": schema.Int64Attribute{ MarkdownDescription: "The size of the collection in bytes.", Computed: true, @@ -62,10 +58,10 @@ func (d *CollectionsDataSource) Schema(ctx context.Context, req datasource.Schem MarkdownDescription: "The dimension of the vectors stored in each record held in the collection.", Computed: true, }, - "vector_count": schema.Int64Attribute{ - MarkdownDescription: "The number of records stored in the collection.", - Computed: true, - }, + // "vector_count": schema.Int64Attribute{ + // MarkdownDescription: "The number of records stored in the collection.", + // Computed: true, + // }, "environment": schema.StringAttribute{ MarkdownDescription: "The environment where the collection is hosted.", Computed: true, @@ -91,14 +87,14 @@ func (d *CollectionsDataSource) Read(ctx context.Context, req datasource.ReadReq return } - collections, err := d.client.Collections().ListCollections() + collections, err := d.client.ListCollections(ctx) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to ListCollections, got error: %s", err)) return } - for _, c := range collections.Collections { - data.Collections = append(data.Collections, *models.NewCollectionModel(&c)) + for _, c := range collections { + data.Collections = append(data.Collections, *models.NewCollectionModel(c)) } // Save data into Terraform state diff --git a/pinecone/provider/collections_data_source_test.go b/pinecone/provider/collections_data_source_test.go index 1b3b6b1..3df0ae9 100644 --- a/pinecone/provider/collections_data_source_test.go +++ b/pinecone/provider/collections_data_source_test.go @@ -23,7 +23,6 @@ func TestAccCollectionsDataSource(t *testing.T) { const testAccCollectionsDataSourceConfig = ` provider "pinecone" { - environment = "us-west4-gcp" } data "pinecone_collections" "test" { diff --git a/pinecone/provider/common.go b/pinecone/provider/common.go index ae9e017..58f6aa6 100644 --- a/pinecone/provider/common.go +++ b/pinecone/provider/common.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" ) type PineconeDatasource struct { diff --git a/pinecone/provider/common_test.go b/pinecone/provider/common_test.go index fd9c4ab..a6f6f06 100644 --- a/pinecone/provider/common_test.go +++ b/pinecone/provider/common_test.go @@ -7,7 +7,7 @@ import ( "context" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" "testing" ) diff --git a/pinecone/provider/index_data_source.go b/pinecone/provider/index_data_source.go index 8d9000c..34b318e 100644 --- a/pinecone/provider/index_data_source.go +++ b/pinecone/provider/index_data_source.go @@ -13,7 +13,7 @@ import ( ) // Ensure provider defined types fully satisfy framework interfaces. -var _ datasource.DataSource = &IndexesDataSource{} +var _ datasource.DataSource = &IndexDataSource{} func NewIndexDataSource() datasource.DataSource { return &IndexDataSource{PineconeDatasource: &PineconeDatasource{}} @@ -148,7 +148,7 @@ func (d *IndexDataSource) Read(ctx context.Context, req datasource.ReadRequest, return } - index, err := d.client.Indexes().DescribeIndex(data.Name.ValueString()) + index, err := d.client.DescribeIndex(ctx, data.Name.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to describe index", err.Error()) return diff --git a/pinecone/provider/index_data_source_test.go b/pinecone/provider/index_data_source_test.go index 0019a58..2571074 100644 --- a/pinecone/provider/index_data_source_test.go +++ b/pinecone/provider/index_data_source_test.go @@ -7,12 +7,12 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccIndexDataSource_serverless(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -37,7 +37,6 @@ func TestAccIndexDataSource_serverless(t *testing.T) { func testAccIndexDataSourceConfig_serverless(name string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { diff --git a/pinecone/provider/index_resource.go b/pinecone/provider/index_resource.go index 4168ab7..02a6cf5 100644 --- a/pinecone/provider/index_resource.go +++ b/pinecone/provider/index_resource.go @@ -6,6 +6,7 @@ package provider import ( "context" "fmt" + "strings" "time" "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" @@ -20,7 +21,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" "github.com/skyscrapr/terraform-provider-pinecone/pinecone/models" ) @@ -197,34 +198,59 @@ func (r *IndexResource) Create(ctx context.Context, req resource.CreateRequest, return } - // Prepare the payload for the API request - payload := pinecone.CreateIndexParams{ - Name: data.Name.ValueString(), - Dimension: int(data.Dimension.ValueInt64()), - Metric: pinecone.IndexMetric(data.Metric.ValueString()), - } - var spec models.IndexSpecModel resp.Diagnostics.Append(data.Spec.As(ctx, &spec, basetypes.ObjectAsOptions{})...) if resp.Diagnostics.HasError() { return } - pod, diags := models.NewIndexPodSpec(ctx, spec.Pod) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } + // Prepare the payload for the API request + if spec.Pod != nil { + podReq := pinecone.CreatePodIndexRequest{ + Name: data.Name.ValueString(), + Dimension: int32(data.Dimension.ValueInt64()), + Metric: pinecone.IndexMetric(data.Metric.ValueString()), + Environment: spec.Pod.Environment.ValueString(), + PodType: spec.Pod.PodType.ValueString(), + Shards: int32(spec.Pod.ShardCount.ValueInt64()), + Replicas: int32(spec.Pod.Replicas.ValueInt64()), + // SourceCollection: spec.Pod.SourceCollection.ValueStringPointer(), + } + + if !spec.Pod.SourceCollection.IsUnknown() { + podReq.SourceCollection = spec.Pod.SourceCollection.ValueStringPointer() + } - payload.Spec = pinecone.IndexSpec{ - Pod: pod, - Serverless: models.NewIndexServerlessSpec(spec.Serverless), + var metadataConfig *pinecone.PodSpecMetadataConfig + if !spec.Pod.MetadataConfig.IsUnknown() { + resp.Diagnostics.Append(spec.Pod.MetadataConfig.As(ctx, &metadataConfig, basetypes.ObjectAsOptions{})...) + if resp.Diagnostics.HasError() { + return + } + } + podReq.MetadataConfig = metadataConfig + + _, err := r.client.CreatePodIndex(ctx, &podReq) + if err != nil { + resp.Diagnostics.AddError("Failed to create pod index", err.Error()) + return + } } - err := r.client.Indexes().CreateIndex(&payload) - if err != nil { - resp.Diagnostics.AddError("Failed to create index", err.Error()) - return + if spec.Serverless != nil { + serverlessReq := pinecone.CreateServerlessIndexRequest{ + Name: data.Name.ValueString(), + Dimension: int32(data.Dimension.ValueInt64()), + Metric: pinecone.IndexMetric(data.Metric.ValueString()), + Cloud: pinecone.Cloud(spec.Serverless.Cloud.ValueString()), + Region: spec.Serverless.Region.ValueString(), + } + + _, err := r.client.CreateServerlessIndex(ctx, &serverlessReq) + if err != nil { + resp.Diagnostics.AddError("Failed to create serverless index", err.Error()) + return + } } // Wait for index to be ready @@ -236,8 +262,8 @@ func (r *IndexResource) Create(ctx context.Context, req resource.CreateRequest, return } - err = retry.RetryContext(ctx, createTimeout, func() *retry.RetryError { - index, err := r.client.Indexes().DescribeIndex(data.Name.ValueString()) + err := retry.RetryContext(ctx, createTimeout, func() *retry.RetryError { + index, err := r.client.DescribeIndex(ctx, data.Name.ValueString()) resp.Diagnostics.Append(data.Read(ctx, index)...) @@ -257,6 +283,8 @@ func (r *IndexResource) Create(ctx context.Context, req resource.CreateRequest, return } + // resp.Diagnostics.Append(data.Read(ctx, index)...) + // Save data into Terraform state resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -271,7 +299,7 @@ func (r *IndexResource) Read(ctx context.Context, req resource.ReadRequest, resp return } - index, err := r.client.Indexes().DescribeIndex(data.Id.ValueString()) + index, err := r.client.DescribeIndex(ctx, data.Id.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to describe index", err.Error()) return @@ -284,73 +312,7 @@ func (r *IndexResource) Read(ctx context.Context, req resource.ReadRequest, resp } func (r *IndexResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var data models.IndexResourceModel - - // Read Terraform plan data into the model - resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...) - - if resp.Diagnostics.HasError() { - return - } - - // Prepare the payload for the API request - payload := pinecone.ConfigureIndexParams{} - - var spec models.IndexSpecModel - resp.Diagnostics.Append(data.Spec.As(ctx, &spec, basetypes.ObjectAsOptions{})...) - if resp.Diagnostics.HasError() { - return - } - - pod, diags := models.NewIndexPodSpec(ctx, spec.Pod) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - payload.Spec = pinecone.IndexSpec{ - Pod: pod, - Serverless: models.NewIndexServerlessSpec(spec.Serverless), - } - - err := r.client.Indexes().ConfigureIndex(data.Name.ValueString(), &payload) - if err != nil { - resp.Diagnostics.AddError("Failed to update index", err.Error()) - return - } - - // Wait for index to be ready - // Create() is passed a default timeout to use if no value - // has been supplied in the Terraform configuration. - updateTimeout, diags := data.Timeouts.Update(ctx, defaultIndexUpdateTimeout) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - err = retry.RetryContext(ctx, updateTimeout, func() *retry.RetryError { - index, err := r.client.Indexes().DescribeIndex(data.Name.ValueString()) - - resp.Diagnostics.Append(data.Read(ctx, index)...) - - // Save current status to state - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) - - if err != nil { - return retry.NonRetryableError(err) - } - if !index.Status.Ready { - return retry.RetryableError(fmt.Errorf("index not ready. State: %s", index.Status.State)) - } - return nil - }) - if err != nil { - resp.Diagnostics.AddError("Failed to wait for index to become ready.", err.Error()) - return - } - - // Save updated data into Terraform state - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + // Update not supported. } func (r *IndexResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { @@ -363,7 +325,7 @@ func (r *IndexResource) Delete(ctx context.Context, req resource.DeleteRequest, return } - err := r.client.Indexes().DeleteIndex(data.Name.ValueString()) + err := r.client.DeleteIndex(ctx, data.Name.ValueString()) if err != nil { resp.Diagnostics.AddError("Failed to delete index", err.Error()) return @@ -379,9 +341,9 @@ func (r *IndexResource) Delete(ctx context.Context, req resource.DeleteRequest, } err = retry.RetryContext(ctx, deleteTimeout, func() *retry.RetryError { - index, err := r.client.Indexes().DescribeIndex(data.Id.ValueString()) + index, err := r.client.DescribeIndex(ctx, data.Id.ValueString()) if err != nil { - if pineconeErr, ok := err.(*pinecone.HTTPError); ok && pineconeErr.StatusCode == 404 { + if strings.Contains(err.Error(), "not found") { return nil } return retry.NonRetryableError(err) diff --git a/pinecone/provider/index_resource_test.go b/pinecone/provider/index_resource_test.go index 8240ccc..1ea296d 100644 --- a/pinecone/provider/index_resource_test.go +++ b/pinecone/provider/index_resource_test.go @@ -7,12 +7,12 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccIndexResource_serverless(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -43,7 +43,7 @@ func TestAccIndexResource_serverless(t *testing.T) { } func TestAccIndexResource_pod_basic(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -76,28 +76,28 @@ func TestAccIndexResource_pod_basic(t *testing.T) { // the upstream service, this can be removed. // ImportStateVerifyIgnore: []string{"configurable_attribute", "defaulted"}, }, - // Update and Read testing - { - Config: testAccIndexResourceConfig_pod_basic(rName, "2", "2"), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("pinecone_index.test", "id", rName), - resource.TestCheckResourceAttr("pinecone_index.test", "name", rName), - resource.TestCheckResourceAttr("pinecone_index.test", "dimension", "1536"), - resource.TestCheckResourceAttr("pinecone_index.test", "metric", "cosine"), - resource.TestCheckResourceAttr("pinecone_index.test", "spec.pod.pod_type", "s1.x1"), - resource.TestCheckResourceAttr("pinecone_index.test", "spec.pod.replicas", "2"), - resource.TestCheckResourceAttr("pinecone_index.test", "spec.pod.pods", "2"), - // resource.TestCheckNoResourceAttr("pinecone_index.test", "metadata_config"), - // resource.TestCheckNoResourceAttr("pinecone_index.test", "source_collection"), - ), - }, + // Update not supported + // { + // Config: testAccIndexResourceConfig_pod_basic(rName, "2", "2"), + // Check: resource.ComposeAggregateTestCheckFunc( + // resource.TestCheckResourceAttr("pinecone_index.test", "id", rName), + // resource.TestCheckResourceAttr("pinecone_index.test", "name", rName), + // resource.TestCheckResourceAttr("pinecone_index.test", "dimension", "1536"), + // resource.TestCheckResourceAttr("pinecone_index.test", "metric", "cosine"), + // resource.TestCheckResourceAttr("pinecone_index.test", "spec.pod.pod_type", "s1.x1"), + // resource.TestCheckResourceAttr("pinecone_index.test", "spec.pod.replicas", "2"), + // resource.TestCheckResourceAttr("pinecone_index.test", "spec.pod.pods", "2"), + // // resource.TestCheckNoResourceAttr("pinecone_index.test", "metadata_config"), + // // resource.TestCheckNoResourceAttr("pinecone_index.test", "source_collection"), + // ), + // }, // Delete testing automatically occurs in TestCase }, }) } func TestAccIndexResource_dimension(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -120,7 +120,6 @@ func TestAccIndexResource_dimension(t *testing.T) { func testAccIndexResourceConfig_serverless(name string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { @@ -138,7 +137,6 @@ resource "pinecone_index" "test" { func testAccIndexResourceConfig_pod_basic(name string, replicas string, pods string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { @@ -158,7 +156,6 @@ resource "pinecone_index" "test" { func testAccIndexResourceConfig_dimension(name string, dimension string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { diff --git a/pinecone/provider/indexes_data_source.go b/pinecone/provider/indexes_data_source.go index e1cc270..47929d0 100644 --- a/pinecone/provider/indexes_data_source.go +++ b/pinecone/provider/indexes_data_source.go @@ -159,15 +159,15 @@ func (d *IndexesDataSource) Read(ctx context.Context, req datasource.ReadRequest return } - indexes, err := d.client.Indexes().ListIndexes() + indexes, err := d.client.ListIndexes(ctx) if err != nil { resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to ListIndexes, got error: %s", err)) return } - for _, i := range indexes.Indexes { + for _, i := range indexes { index := models.IndexModel{} - resp.Diagnostics.Append(index.Read(ctx, &i)...) + resp.Diagnostics.Append(index.Read(ctx, i)...) if resp.Diagnostics.HasError() { return } diff --git a/pinecone/provider/indexes_data_source_test.go b/pinecone/provider/indexes_data_source_test.go index 6bd1ef1..c256b8e 100644 --- a/pinecone/provider/indexes_data_source_test.go +++ b/pinecone/provider/indexes_data_source_test.go @@ -7,12 +7,12 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccIndexesDataSource(t *testing.T) { - rName := sdkacctest.RandomWithPrefix("tftest") + rName := acctest.RandomWithPrefix("tftest") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -32,7 +32,6 @@ func TestAccIndexesDataSource(t *testing.T) { func testAccIndexesDataSourceConfig(name string) string { return fmt.Sprintf(` provider "pinecone" { - environment = "us-west4-gcp" } resource "pinecone_index" "test" { diff --git a/pinecone/provider/provider.go b/pinecone/provider/provider.go index 5d224aa..7ff387d 100644 --- a/pinecone/provider/provider.go +++ b/pinecone/provider/provider.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/skyscrapr/pinecone-sdk-go/pinecone" + "github.com/pinecone-io/go-pinecone/pinecone" ) // Ensure PineconeProvider satisfies various provider interfaces. @@ -28,8 +28,7 @@ type PineconeProvider struct { // PineconeProviderModel describes the provider data model. type PineconeProviderModel struct { - ApiKey types.String `tfsdk:"api_key"` - Environment types.String `tfsdk:"environment"` + ApiKey types.String `tfsdk:"api_key"` } func (p *PineconeProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) { @@ -45,10 +44,6 @@ func (p *PineconeProvider) Schema(ctx context.Context, req provider.SchemaReques Optional: true, Sensitive: true, }, - "environment": schema.StringAttribute{ - MarkdownDescription: "Pinecone Environment. Can be configured by setting PINECONE_ENVIRONMENT environment variable.", - Optional: true, - }, }, } } @@ -69,11 +64,13 @@ func (p *PineconeProvider) Configure(ctx context.Context, req provider.Configure apiKey = data.ApiKey.ValueString() } - env := os.Getenv("PINECONE_ENVIRONMENT") - if !data.Environment.IsNull() { - env = data.Environment.ValueString() + client, err := pinecone.NewClient(pinecone.NewClientParams{ + ApiKey: apiKey, + }) + if err != nil { + resp.Diagnostics.AddError("Failed to create pinecone client", err.Error()) + return } - client := pinecone.NewClient(apiKey, env) resp.DataSourceData = client resp.ResourceData = client