From 32a1ee14ec30fb8abe2ce2c90f0eaa5289e642d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:43:08 +0000 Subject: [PATCH 1/8] Bump golang.org/x/mod from 0.16.0 to 0.17.0 (#879) Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.16.0 to 0.17.0.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/mod&package-manager=go_modules&previous-version=0.16.0&new-version=0.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 67e4b4fda..31d353d93 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/mod v0.16.0 + golang.org/x/mod v0.17.0 golang.org/x/net v0.24.0 golang.org/x/oauth2 v0.18.0 golang.org/x/time v0.5.0 diff --git a/go.sum b/go.sum index ca6f799e0..ca0664041 100644 --- a/go.sum +++ b/go.sum @@ -95,8 +95,8 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= From ece8e54527c909a1557edf4523cfc703d4647c43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:49:08 +0000 Subject: [PATCH 2/8] Bump golang.org/x/oauth2 from 0.18.0 to 0.20.0 (#911) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.18.0 to 0.20.0.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/oauth2&package-manager=go_modules&previous-version=0.18.0&new-version=0.20.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 ++---- go.sum | 31 ++++--------------------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 31d353d93..70b43be03 100644 --- a/go.mod +++ b/go.mod @@ -9,15 +9,14 @@ require ( golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/mod v0.17.0 golang.org/x/net v0.24.0 - golang.org/x/oauth2 v0.18.0 + golang.org/x/oauth2 v0.20.0 golang.org/x/time v0.5.0 google.golang.org/api v0.169.0 gopkg.in/ini.v1 v1.67.0 ) require ( - cloud.google.com/go/compute v1.23.4 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -36,7 +35,6 @@ require ( golang.org/x/crypto v0.22.0 // indirect golang.org/x/sys v0.19.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-20240304161311-37d4d3c04a78 // indirect google.golang.org/grpc v1.62.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index ca0664041..cab30891f 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/compute v1.23.4 h1:EBT9Nw4q3zyE7G45Wvv3MzolIrCJEuHys5muLY0wvAw= -cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -36,7 +34,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 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/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -71,7 +68,6 @@ 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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= @@ -85,7 +81,6 @@ go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -94,7 +89,6 @@ golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -102,36 +96,24 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -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.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.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/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.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= 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/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -141,16 +123,11 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -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 v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= From 6a39af444ed506e859feacda07fa62eaf6e55e63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:54:45 +0200 Subject: [PATCH 3/8] Bump golang.org/x/net from 0.24.0 to 0.25.0 (#912) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.24.0 to 0.25.0.
Commits
  • d27919b go.mod: update golang.org/x dependencies
  • e0324fc http2: use net.ErrClosed
  • b20cd59 quic: initiate key rotation earlier in connections
  • f95a3b3 html: fix typo in package doc
  • 0a24555 http/httpguts: speed up ValidHeaderFieldName
  • ec05fdc http2: don't retry the first request on a connection on GOAWAY error
  • b67a0f0 http2: send correct LastStreamID in stream-caused GOAWAY
  • a130fcc quic: don't consider goroutines running when tests start as leaked
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.24.0&new-version=0.25.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 70b43be03..e43d98534 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/mod v0.17.0 - golang.org/x/net v0.24.0 + golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 golang.org/x/time v0.5.0 google.golang.org/api v0.169.0 @@ -32,9 +32,9 @@ require ( go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 // indirect google.golang.org/grpc v1.62.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index cab30891f..ad8277384 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= @@ -97,8 +97,8 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -110,12 +110,12 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 70fcacb0a4a0205c687190ddcc8781bd0b283b7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:59:34 +0200 Subject: [PATCH 4/8] Bump google.golang.org/api from 0.169.0 to 0.182.0 (#932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [//]: # (dependabot-start) ⚠️ **Dependabot is rebasing this PR** ⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.169.0 to 0.182.0.
Release notes

Sourced from google.golang.org/api's releases.

v0.182.0

0.182.0 (2024-05-28)

Features

v0.181.0

0.181.0 (2024-05-16)

Features

v0.180.0

0.180.0 (2024-05-10)

Features

v0.179.0

0.179.0 (2024-05-09)

Features

... (truncated)

Changelog

Sourced from google.golang.org/api's changelog.

0.182.0 (2024-05-28)

Features

0.181.0 (2024-05-16)

Features

0.180.0 (2024-05-10)

Features

0.179.0 (2024-05-09)

Features

Bug Fixes

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/api&package-manager=go_modules&previous-version=0.169.0&new-version=0.182.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 +++++++----- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index e43d98534..57acf4cb1 100644 --- a/go.mod +++ b/go.mod @@ -11,18 +11,20 @@ require ( golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 golang.org/x/time v0.5.0 - google.golang.org/api v0.169.0 + google.golang.org/api v0.182.0 gopkg.in/ini.v1 v1.67.0 ) require ( + cloud.google.com/go/auth v0.4.2 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -35,8 +37,8 @@ require ( golang.org/x/crypto v0.23.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 // indirect - google.golang.org/grpc v1.62.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ad8277384..8cdfc57fd 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go/auth v0.4.2 h1:sb0eyLkhRtpq5jA+a8KWw0W70YcdVca7KJ8TM0AFYDg= +cloud.google.com/go/auth v0.4.2/go.mod h1:Kqvlz1cf1sNA0D+sYJnkPQOP+JMHkuHeIgVmCRtZOLc= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -33,9 +37,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -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.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -43,7 +46,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/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-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -54,7 +56,7 @@ 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/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -105,7 +107,7 @@ golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -124,22 +126,22 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= -google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.182.0 h1:if5fPvudRQ78GeRx3RayIoiuV7modtErPIZC/T2bIvE= +google.golang.org/api v0.182.0/go.mod h1:cGhjy4caqA5yXRzEhkHI8Y9mfyC2VLTlER2l08xaqtM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 h1:Xs9lu+tLXxLIfuci70nG4cpwaRC+mRQPUL7LoIeDJC4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -149,10 +151,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= From 134b78e3243a1666020a958f40a092c18b3c25c1 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 3 Jun 2024 13:02:05 +0200 Subject: [PATCH 5/8] Update OpenAPI spec (#934) ## Changes Notable changes: * Pagination of account-level storage credentials * Add batch get APIs for marketplace listings * Rename app deployment method ## Tests - [x] `make test` passing - [x] `make fmt` applied - [x] relevant integration tests applied --- .codegen/_openapi_sha | 2 +- ...k_account_storage_credentials_interface.go | 171 ++++--------- .../mock_consumer_listings_interface.go | 59 +++++ .../mock_consumer_providers_interface.go | 59 +++++ .../service/serving/mock_apps_interface.go | 232 +++++++++--------- service/catalog/api.go | 88 ++----- service/catalog/impl.go | 8 +- service/catalog/interface.go | 4 +- service/catalog/model.go | 47 +++- service/compute/model.go | 26 +- service/jobs/model.go | 2 + service/marketplace/api.go | 28 +++ service/marketplace/impl.go | 18 ++ service/marketplace/interface.go | 12 + service/marketplace/model.go | 18 ++ service/oauth2/model.go | 17 ++ service/serving/api.go | 132 +++++----- service/serving/impl.go | 20 +- service/serving/interface.go | 28 +-- service/serving/model.go | 99 +++++--- service/sql/model.go | 3 +- 21 files changed, 638 insertions(+), 435 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 8c62ac620..de0f45ab9 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -7eb5ad9a2ed3e3f1055968a2d1014ac92c06fe92 \ No newline at end of file +37b925eba37dfb3d7e05b6ba2d458454ce62d3a0 \ No newline at end of file diff --git a/experimental/mocks/service/catalog/mock_account_storage_credentials_interface.go b/experimental/mocks/service/catalog/mock_account_storage_credentials_interface.go index cc623fca9..ff4db744d 100644 --- a/experimental/mocks/service/catalog/mock_account_storage_credentials_interface.go +++ b/experimental/mocks/service/catalog/mock_account_storage_credentials_interface.go @@ -7,6 +7,8 @@ import ( catalog "github.com/databricks/databricks-sdk-go/service/catalog" + listing "github.com/databricks/databricks-sdk-go/listing" + mock "github.com/stretchr/testify/mock" ) @@ -296,65 +298,6 @@ func (_c *MockAccountStorageCredentialsInterface_GetByMetastoreIdAndStorageCrede return _c } -// GetByName provides a mock function with given fields: ctx, name -func (_m *MockAccountStorageCredentialsInterface) GetByName(ctx context.Context, name string) (*catalog.StorageCredentialInfo, error) { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for GetByName") - } - - var r0 *catalog.StorageCredentialInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.StorageCredentialInfo, error)); ok { - return rf(ctx, name) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.StorageCredentialInfo); ok { - r0 = rf(ctx, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*catalog.StorageCredentialInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAccountStorageCredentialsInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' -type MockAccountStorageCredentialsInterface_GetByName_Call struct { - *mock.Call -} - -// GetByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockAccountStorageCredentialsInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockAccountStorageCredentialsInterface_GetByName_Call { - return &MockAccountStorageCredentialsInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} -} - -func (_c *MockAccountStorageCredentialsInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockAccountStorageCredentialsInterface_GetByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAccountStorageCredentialsInterface_GetByName_Call) Return(_a0 *catalog.StorageCredentialInfo, _a1 error) *MockAccountStorageCredentialsInterface_GetByName_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAccountStorageCredentialsInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.StorageCredentialInfo, error)) *MockAccountStorageCredentialsInterface_GetByName_Call { - _c.Call.Return(run) - return _c -} - // Impl provides a mock function with given fields: func (_m *MockAccountStorageCredentialsInterface) Impl() catalog.AccountStorageCredentialsService { ret := _m.Called() @@ -403,33 +346,23 @@ func (_c *MockAccountStorageCredentialsInterface_Impl_Call) RunAndReturn(run fun } // List provides a mock function with given fields: ctx, request -func (_m *MockAccountStorageCredentialsInterface) List(ctx context.Context, request catalog.ListAccountStorageCredentialsRequest) ([]catalog.StorageCredentialInfo, error) { +func (_m *MockAccountStorageCredentialsInterface) List(ctx context.Context, request catalog.ListAccountStorageCredentialsRequest) listing.Iterator[catalog.StorageCredentialInfo] { ret := _m.Called(ctx, request) if len(ret) == 0 { panic("no return value specified for List") } - var r0 []catalog.StorageCredentialInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) ([]catalog.StorageCredentialInfo, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) []catalog.StorageCredentialInfo); ok { + var r0 listing.Iterator[catalog.StorageCredentialInfo] + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) listing.Iterator[catalog.StorageCredentialInfo]); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]catalog.StorageCredentialInfo) + r0 = ret.Get(0).(listing.Iterator[catalog.StorageCredentialInfo]) } } - if rf, ok := ret.Get(1).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 + return r0 } // MockAccountStorageCredentialsInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' @@ -451,39 +384,39 @@ func (_c *MockAccountStorageCredentialsInterface_List_Call) Run(run func(ctx con return _c } -func (_c *MockAccountStorageCredentialsInterface_List_Call) Return(_a0 []catalog.StorageCredentialInfo, _a1 error) *MockAccountStorageCredentialsInterface_List_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockAccountStorageCredentialsInterface_List_Call) Return(_a0 listing.Iterator[catalog.StorageCredentialInfo]) *MockAccountStorageCredentialsInterface_List_Call { + _c.Call.Return(_a0) return _c } -func (_c *MockAccountStorageCredentialsInterface_List_Call) RunAndReturn(run func(context.Context, catalog.ListAccountStorageCredentialsRequest) ([]catalog.StorageCredentialInfo, error)) *MockAccountStorageCredentialsInterface_List_Call { +func (_c *MockAccountStorageCredentialsInterface_List_Call) RunAndReturn(run func(context.Context, catalog.ListAccountStorageCredentialsRequest) listing.Iterator[catalog.StorageCredentialInfo]) *MockAccountStorageCredentialsInterface_List_Call { _c.Call.Return(run) return _c } -// ListByMetastoreId provides a mock function with given fields: ctx, metastoreId -func (_m *MockAccountStorageCredentialsInterface) ListByMetastoreId(ctx context.Context, metastoreId string) ([]catalog.StorageCredentialInfo, error) { - ret := _m.Called(ctx, metastoreId) +// ListAll provides a mock function with given fields: ctx, request +func (_m *MockAccountStorageCredentialsInterface) ListAll(ctx context.Context, request catalog.ListAccountStorageCredentialsRequest) ([]catalog.StorageCredentialInfo, error) { + ret := _m.Called(ctx, request) if len(ret) == 0 { - panic("no return value specified for ListByMetastoreId") + panic("no return value specified for ListAll") } var r0 []catalog.StorageCredentialInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) ([]catalog.StorageCredentialInfo, error)); ok { - return rf(ctx, metastoreId) + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) ([]catalog.StorageCredentialInfo, error)); ok { + return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, string) []catalog.StorageCredentialInfo); ok { - r0 = rf(ctx, metastoreId) + if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) []catalog.StorageCredentialInfo); ok { + r0 = rf(ctx, request) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]catalog.StorageCredentialInfo) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, metastoreId) + if rf, ok := ret.Get(1).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) error); ok { + r1 = rf(ctx, request) } else { r1 = ret.Error(1) } @@ -491,58 +424,58 @@ func (_m *MockAccountStorageCredentialsInterface) ListByMetastoreId(ctx context. return r0, r1 } -// MockAccountStorageCredentialsInterface_ListByMetastoreId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListByMetastoreId' -type MockAccountStorageCredentialsInterface_ListByMetastoreId_Call struct { +// MockAccountStorageCredentialsInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' +type MockAccountStorageCredentialsInterface_ListAll_Call struct { *mock.Call } -// ListByMetastoreId is a helper method to define mock.On call +// ListAll is a helper method to define mock.On call // - ctx context.Context -// - metastoreId string -func (_e *MockAccountStorageCredentialsInterface_Expecter) ListByMetastoreId(ctx interface{}, metastoreId interface{}) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { - return &MockAccountStorageCredentialsInterface_ListByMetastoreId_Call{Call: _e.mock.On("ListByMetastoreId", ctx, metastoreId)} +// - request catalog.ListAccountStorageCredentialsRequest +func (_e *MockAccountStorageCredentialsInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockAccountStorageCredentialsInterface_ListAll_Call { + return &MockAccountStorageCredentialsInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} } -func (_c *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call) Run(run func(ctx context.Context, metastoreId string)) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { +func (_c *MockAccountStorageCredentialsInterface_ListAll_Call) Run(run func(ctx context.Context, request catalog.ListAccountStorageCredentialsRequest)) *MockAccountStorageCredentialsInterface_ListAll_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + run(args[0].(context.Context), args[1].(catalog.ListAccountStorageCredentialsRequest)) }) return _c } -func (_c *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call) Return(_a0 []catalog.StorageCredentialInfo, _a1 error) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { +func (_c *MockAccountStorageCredentialsInterface_ListAll_Call) Return(_a0 []catalog.StorageCredentialInfo, _a1 error) *MockAccountStorageCredentialsInterface_ListAll_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call) RunAndReturn(run func(context.Context, string) ([]catalog.StorageCredentialInfo, error)) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { +func (_c *MockAccountStorageCredentialsInterface_ListAll_Call) RunAndReturn(run func(context.Context, catalog.ListAccountStorageCredentialsRequest) ([]catalog.StorageCredentialInfo, error)) *MockAccountStorageCredentialsInterface_ListAll_Call { _c.Call.Return(run) return _c } -// StorageCredentialInfoNameToIdMap provides a mock function with given fields: ctx, request -func (_m *MockAccountStorageCredentialsInterface) StorageCredentialInfoNameToIdMap(ctx context.Context, request catalog.ListAccountStorageCredentialsRequest) (map[string]string, error) { - ret := _m.Called(ctx, request) +// ListByMetastoreId provides a mock function with given fields: ctx, metastoreId +func (_m *MockAccountStorageCredentialsInterface) ListByMetastoreId(ctx context.Context, metastoreId string) (*catalog.ListAccountStorageCredentialsResponse, error) { + ret := _m.Called(ctx, metastoreId) if len(ret) == 0 { - panic("no return value specified for StorageCredentialInfoNameToIdMap") + panic("no return value specified for ListByMetastoreId") } - var r0 map[string]string + var r0 *catalog.ListAccountStorageCredentialsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) (map[string]string, error)); ok { - return rf(ctx, request) + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.ListAccountStorageCredentialsResponse, error)); ok { + return rf(ctx, metastoreId) } - if rf, ok := ret.Get(0).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) map[string]string); ok { - r0 = rf(ctx, request) + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.ListAccountStorageCredentialsResponse); ok { + r0 = rf(ctx, metastoreId) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(map[string]string) + r0 = ret.Get(0).(*catalog.ListAccountStorageCredentialsResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, catalog.ListAccountStorageCredentialsRequest) error); ok { - r1 = rf(ctx, request) + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, metastoreId) } else { r1 = ret.Error(1) } @@ -550,31 +483,31 @@ func (_m *MockAccountStorageCredentialsInterface) StorageCredentialInfoNameToIdM return r0, r1 } -// MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StorageCredentialInfoNameToIdMap' -type MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call struct { +// MockAccountStorageCredentialsInterface_ListByMetastoreId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListByMetastoreId' +type MockAccountStorageCredentialsInterface_ListByMetastoreId_Call struct { *mock.Call } -// StorageCredentialInfoNameToIdMap is a helper method to define mock.On call +// ListByMetastoreId is a helper method to define mock.On call // - ctx context.Context -// - request catalog.ListAccountStorageCredentialsRequest -func (_e *MockAccountStorageCredentialsInterface_Expecter) StorageCredentialInfoNameToIdMap(ctx interface{}, request interface{}) *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call { - return &MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call{Call: _e.mock.On("StorageCredentialInfoNameToIdMap", ctx, request)} +// - metastoreId string +func (_e *MockAccountStorageCredentialsInterface_Expecter) ListByMetastoreId(ctx interface{}, metastoreId interface{}) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { + return &MockAccountStorageCredentialsInterface_ListByMetastoreId_Call{Call: _e.mock.On("ListByMetastoreId", ctx, metastoreId)} } -func (_c *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call) Run(run func(ctx context.Context, request catalog.ListAccountStorageCredentialsRequest)) *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call { +func (_c *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call) Run(run func(ctx context.Context, metastoreId string)) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(catalog.ListAccountStorageCredentialsRequest)) + run(args[0].(context.Context), args[1].(string)) }) return _c } -func (_c *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call) Return(_a0 map[string]string, _a1 error) *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call { +func (_c *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call) Return(_a0 *catalog.ListAccountStorageCredentialsResponse, _a1 error) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call) RunAndReturn(run func(context.Context, catalog.ListAccountStorageCredentialsRequest) (map[string]string, error)) *MockAccountStorageCredentialsInterface_StorageCredentialInfoNameToIdMap_Call { +func (_c *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call) RunAndReturn(run func(context.Context, string) (*catalog.ListAccountStorageCredentialsResponse, error)) *MockAccountStorageCredentialsInterface_ListByMetastoreId_Call { _c.Call.Return(run) return _c } diff --git a/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go b/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go index e1b389f9f..4fb554721 100644 --- a/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go +++ b/experimental/mocks/service/marketplace/mock_consumer_listings_interface.go @@ -24,6 +24,65 @@ func (_m *MockConsumerListingsInterface) EXPECT() *MockConsumerListingsInterface return &MockConsumerListingsInterface_Expecter{mock: &_m.Mock} } +// BatchGet provides a mock function with given fields: ctx, request +func (_m *MockConsumerListingsInterface) BatchGet(ctx context.Context, request marketplace.BatchGetListingsRequest) (*marketplace.BatchGetListingsResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for BatchGet") + } + + var r0 *marketplace.BatchGetListingsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.BatchGetListingsRequest) (*marketplace.BatchGetListingsResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.BatchGetListingsRequest) *marketplace.BatchGetListingsResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.BatchGetListingsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.BatchGetListingsRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerListingsInterface_BatchGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchGet' +type MockConsumerListingsInterface_BatchGet_Call struct { + *mock.Call +} + +// BatchGet is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.BatchGetListingsRequest +func (_e *MockConsumerListingsInterface_Expecter) BatchGet(ctx interface{}, request interface{}) *MockConsumerListingsInterface_BatchGet_Call { + return &MockConsumerListingsInterface_BatchGet_Call{Call: _e.mock.On("BatchGet", ctx, request)} +} + +func (_c *MockConsumerListingsInterface_BatchGet_Call) Run(run func(ctx context.Context, request marketplace.BatchGetListingsRequest)) *MockConsumerListingsInterface_BatchGet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.BatchGetListingsRequest)) + }) + return _c +} + +func (_c *MockConsumerListingsInterface_BatchGet_Call) Return(_a0 *marketplace.BatchGetListingsResponse, _a1 error) *MockConsumerListingsInterface_BatchGet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerListingsInterface_BatchGet_Call) RunAndReturn(run func(context.Context, marketplace.BatchGetListingsRequest) (*marketplace.BatchGetListingsResponse, error)) *MockConsumerListingsInterface_BatchGet_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, request func (_m *MockConsumerListingsInterface) Get(ctx context.Context, request marketplace.GetListingRequest) (*marketplace.GetListingResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go b/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go index 4aad119a2..55b54f4ce 100644 --- a/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go +++ b/experimental/mocks/service/marketplace/mock_consumer_providers_interface.go @@ -24,6 +24,65 @@ func (_m *MockConsumerProvidersInterface) EXPECT() *MockConsumerProvidersInterfa return &MockConsumerProvidersInterface_Expecter{mock: &_m.Mock} } +// BatchGet provides a mock function with given fields: ctx, request +func (_m *MockConsumerProvidersInterface) BatchGet(ctx context.Context, request marketplace.BatchGetProvidersRequest) (*marketplace.BatchGetProvidersResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for BatchGet") + } + + var r0 *marketplace.BatchGetProvidersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, marketplace.BatchGetProvidersRequest) (*marketplace.BatchGetProvidersResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, marketplace.BatchGetProvidersRequest) *marketplace.BatchGetProvidersResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*marketplace.BatchGetProvidersResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, marketplace.BatchGetProvidersRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockConsumerProvidersInterface_BatchGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchGet' +type MockConsumerProvidersInterface_BatchGet_Call struct { + *mock.Call +} + +// BatchGet is a helper method to define mock.On call +// - ctx context.Context +// - request marketplace.BatchGetProvidersRequest +func (_e *MockConsumerProvidersInterface_Expecter) BatchGet(ctx interface{}, request interface{}) *MockConsumerProvidersInterface_BatchGet_Call { + return &MockConsumerProvidersInterface_BatchGet_Call{Call: _e.mock.On("BatchGet", ctx, request)} +} + +func (_c *MockConsumerProvidersInterface_BatchGet_Call) Run(run func(ctx context.Context, request marketplace.BatchGetProvidersRequest)) *MockConsumerProvidersInterface_BatchGet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(marketplace.BatchGetProvidersRequest)) + }) + return _c +} + +func (_c *MockConsumerProvidersInterface_BatchGet_Call) Return(_a0 *marketplace.BatchGetProvidersResponse, _a1 error) *MockConsumerProvidersInterface_BatchGet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockConsumerProvidersInterface_BatchGet_Call) RunAndReturn(run func(context.Context, marketplace.BatchGetProvidersRequest) (*marketplace.BatchGetProvidersResponse, error)) *MockConsumerProvidersInterface_BatchGet_Call { + _c.Call.Return(run) + return _c +} + // Get provides a mock function with given fields: ctx, request func (_m *MockConsumerProvidersInterface) Get(ctx context.Context, request marketplace.GetProviderRequest) (*marketplace.GetProviderResponse, error) { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/serving/mock_apps_interface.go b/experimental/mocks/service/serving/mock_apps_interface.go index ba56adb35..7ebbff688 100644 --- a/experimental/mocks/service/serving/mock_apps_interface.go +++ b/experimental/mocks/service/serving/mock_apps_interface.go @@ -161,12 +161,106 @@ func (_c *MockAppsInterface_CreateAndWait_Call) RunAndReturn(run func(context.Co return _c } -// CreateDeployment provides a mock function with given fields: ctx, createAppDeploymentRequest -func (_m *MockAppsInterface) CreateDeployment(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest) (*serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment], error) { +// Delete provides a mock function with given fields: ctx, request +func (_m *MockAppsInterface) Delete(ctx context.Context, request serving.DeleteAppRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, serving.DeleteAppRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAppsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockAppsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request serving.DeleteAppRequest +func (_e *MockAppsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockAppsInterface_Delete_Call { + return &MockAppsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockAppsInterface_Delete_Call) Run(run func(ctx context.Context, request serving.DeleteAppRequest)) *MockAppsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(serving.DeleteAppRequest)) + }) + return _c +} + +func (_c *MockAppsInterface_Delete_Call) Return(_a0 error) *MockAppsInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAppsInterface_Delete_Call) RunAndReturn(run func(context.Context, serving.DeleteAppRequest) error) *MockAppsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteByName provides a mock function with given fields: ctx, name +func (_m *MockAppsInterface) DeleteByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteByName") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAppsInterface_DeleteByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByName' +type MockAppsInterface_DeleteByName_Call struct { + *mock.Call +} + +// DeleteByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockAppsInterface_Expecter) DeleteByName(ctx interface{}, name interface{}) *MockAppsInterface_DeleteByName_Call { + return &MockAppsInterface_DeleteByName_Call{Call: _e.mock.On("DeleteByName", ctx, name)} +} + +func (_c *MockAppsInterface_DeleteByName_Call) Run(run func(ctx context.Context, name string)) *MockAppsInterface_DeleteByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAppsInterface_DeleteByName_Call) Return(_a0 error) *MockAppsInterface_DeleteByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAppsInterface_DeleteByName_Call) RunAndReturn(run func(context.Context, string) error) *MockAppsInterface_DeleteByName_Call { + _c.Call.Return(run) + return _c +} + +// Deploy provides a mock function with given fields: ctx, createAppDeploymentRequest +func (_m *MockAppsInterface) Deploy(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest) (*serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment], error) { ret := _m.Called(ctx, createAppDeploymentRequest) if len(ret) == 0 { - panic("no return value specified for CreateDeployment") + panic("no return value specified for Deploy") } var r0 *serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment] @@ -191,37 +285,37 @@ func (_m *MockAppsInterface) CreateDeployment(ctx context.Context, createAppDepl return r0, r1 } -// MockAppsInterface_CreateDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDeployment' -type MockAppsInterface_CreateDeployment_Call struct { +// MockAppsInterface_Deploy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deploy' +type MockAppsInterface_Deploy_Call struct { *mock.Call } -// CreateDeployment is a helper method to define mock.On call +// Deploy is a helper method to define mock.On call // - ctx context.Context // - createAppDeploymentRequest serving.CreateAppDeploymentRequest -func (_e *MockAppsInterface_Expecter) CreateDeployment(ctx interface{}, createAppDeploymentRequest interface{}) *MockAppsInterface_CreateDeployment_Call { - return &MockAppsInterface_CreateDeployment_Call{Call: _e.mock.On("CreateDeployment", ctx, createAppDeploymentRequest)} +func (_e *MockAppsInterface_Expecter) Deploy(ctx interface{}, createAppDeploymentRequest interface{}) *MockAppsInterface_Deploy_Call { + return &MockAppsInterface_Deploy_Call{Call: _e.mock.On("Deploy", ctx, createAppDeploymentRequest)} } -func (_c *MockAppsInterface_CreateDeployment_Call) Run(run func(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest)) *MockAppsInterface_CreateDeployment_Call { +func (_c *MockAppsInterface_Deploy_Call) Run(run func(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest)) *MockAppsInterface_Deploy_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(serving.CreateAppDeploymentRequest)) }) return _c } -func (_c *MockAppsInterface_CreateDeployment_Call) Return(_a0 *serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment], _a1 error) *MockAppsInterface_CreateDeployment_Call { +func (_c *MockAppsInterface_Deploy_Call) Return(_a0 *serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment], _a1 error) *MockAppsInterface_Deploy_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockAppsInterface_CreateDeployment_Call) RunAndReturn(run func(context.Context, serving.CreateAppDeploymentRequest) (*serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment], error)) *MockAppsInterface_CreateDeployment_Call { +func (_c *MockAppsInterface_Deploy_Call) RunAndReturn(run func(context.Context, serving.CreateAppDeploymentRequest) (*serving.WaitGetDeploymentAppSucceeded[serving.AppDeployment], error)) *MockAppsInterface_Deploy_Call { _c.Call.Return(run) return _c } -// CreateDeploymentAndWait provides a mock function with given fields: ctx, createAppDeploymentRequest, options -func (_m *MockAppsInterface) CreateDeploymentAndWait(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest, options ...retries.Option[serving.AppDeployment]) (*serving.AppDeployment, error) { +// DeployAndWait provides a mock function with given fields: ctx, createAppDeploymentRequest, options +func (_m *MockAppsInterface) DeployAndWait(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest, options ...retries.Option[serving.AppDeployment]) (*serving.AppDeployment, error) { _va := make([]interface{}, len(options)) for _i := range options { _va[_i] = options[_i] @@ -232,7 +326,7 @@ func (_m *MockAppsInterface) CreateDeploymentAndWait(ctx context.Context, create ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for CreateDeploymentAndWait") + panic("no return value specified for DeployAndWait") } var r0 *serving.AppDeployment @@ -257,21 +351,21 @@ func (_m *MockAppsInterface) CreateDeploymentAndWait(ctx context.Context, create return r0, r1 } -// MockAppsInterface_CreateDeploymentAndWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDeploymentAndWait' -type MockAppsInterface_CreateDeploymentAndWait_Call struct { +// MockAppsInterface_DeployAndWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeployAndWait' +type MockAppsInterface_DeployAndWait_Call struct { *mock.Call } -// CreateDeploymentAndWait is a helper method to define mock.On call +// DeployAndWait is a helper method to define mock.On call // - ctx context.Context // - createAppDeploymentRequest serving.CreateAppDeploymentRequest // - options ...retries.Option[serving.AppDeployment] -func (_e *MockAppsInterface_Expecter) CreateDeploymentAndWait(ctx interface{}, createAppDeploymentRequest interface{}, options ...interface{}) *MockAppsInterface_CreateDeploymentAndWait_Call { - return &MockAppsInterface_CreateDeploymentAndWait_Call{Call: _e.mock.On("CreateDeploymentAndWait", +func (_e *MockAppsInterface_Expecter) DeployAndWait(ctx interface{}, createAppDeploymentRequest interface{}, options ...interface{}) *MockAppsInterface_DeployAndWait_Call { + return &MockAppsInterface_DeployAndWait_Call{Call: _e.mock.On("DeployAndWait", append([]interface{}{ctx, createAppDeploymentRequest}, options...)...)} } -func (_c *MockAppsInterface_CreateDeploymentAndWait_Call) Run(run func(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest, options ...retries.Option[serving.AppDeployment])) *MockAppsInterface_CreateDeploymentAndWait_Call { +func (_c *MockAppsInterface_DeployAndWait_Call) Run(run func(ctx context.Context, createAppDeploymentRequest serving.CreateAppDeploymentRequest, options ...retries.Option[serving.AppDeployment])) *MockAppsInterface_DeployAndWait_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]retries.Option[serving.AppDeployment], len(args)-2) for i, a := range args[2:] { @@ -284,106 +378,12 @@ func (_c *MockAppsInterface_CreateDeploymentAndWait_Call) Run(run func(ctx conte return _c } -func (_c *MockAppsInterface_CreateDeploymentAndWait_Call) Return(_a0 *serving.AppDeployment, _a1 error) *MockAppsInterface_CreateDeploymentAndWait_Call { +func (_c *MockAppsInterface_DeployAndWait_Call) Return(_a0 *serving.AppDeployment, _a1 error) *MockAppsInterface_DeployAndWait_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockAppsInterface_CreateDeploymentAndWait_Call) RunAndReturn(run func(context.Context, serving.CreateAppDeploymentRequest, ...retries.Option[serving.AppDeployment]) (*serving.AppDeployment, error)) *MockAppsInterface_CreateDeploymentAndWait_Call { - _c.Call.Return(run) - return _c -} - -// Delete provides a mock function with given fields: ctx, request -func (_m *MockAppsInterface) Delete(ctx context.Context, request serving.DeleteAppRequest) error { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for Delete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, serving.DeleteAppRequest) error); ok { - r0 = rf(ctx, request) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAppsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type MockAppsInterface_Delete_Call struct { - *mock.Call -} - -// Delete is a helper method to define mock.On call -// - ctx context.Context -// - request serving.DeleteAppRequest -func (_e *MockAppsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockAppsInterface_Delete_Call { - return &MockAppsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} -} - -func (_c *MockAppsInterface_Delete_Call) Run(run func(ctx context.Context, request serving.DeleteAppRequest)) *MockAppsInterface_Delete_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(serving.DeleteAppRequest)) - }) - return _c -} - -func (_c *MockAppsInterface_Delete_Call) Return(_a0 error) *MockAppsInterface_Delete_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAppsInterface_Delete_Call) RunAndReturn(run func(context.Context, serving.DeleteAppRequest) error) *MockAppsInterface_Delete_Call { - _c.Call.Return(run) - return _c -} - -// DeleteByName provides a mock function with given fields: ctx, name -func (_m *MockAppsInterface) DeleteByName(ctx context.Context, name string) error { - ret := _m.Called(ctx, name) - - if len(ret) == 0 { - panic("no return value specified for DeleteByName") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, name) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAppsInterface_DeleteByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByName' -type MockAppsInterface_DeleteByName_Call struct { - *mock.Call -} - -// DeleteByName is a helper method to define mock.On call -// - ctx context.Context -// - name string -func (_e *MockAppsInterface_Expecter) DeleteByName(ctx interface{}, name interface{}) *MockAppsInterface_DeleteByName_Call { - return &MockAppsInterface_DeleteByName_Call{Call: _e.mock.On("DeleteByName", ctx, name)} -} - -func (_c *MockAppsInterface_DeleteByName_Call) Run(run func(ctx context.Context, name string)) *MockAppsInterface_DeleteByName_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAppsInterface_DeleteByName_Call) Return(_a0 error) *MockAppsInterface_DeleteByName_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAppsInterface_DeleteByName_Call) RunAndReturn(run func(context.Context, string) error) *MockAppsInterface_DeleteByName_Call { +func (_c *MockAppsInterface_DeployAndWait_Call) RunAndReturn(run func(context.Context, serving.CreateAppDeploymentRequest, ...retries.Option[serving.AppDeployment]) (*serving.AppDeployment, error)) *MockAppsInterface_DeployAndWait_Call { _c.Call.Return(run) return _c } diff --git a/service/catalog/api.go b/service/catalog/api.go index fb20a6ef4..fcfa5423b 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -431,31 +431,23 @@ type AccountStorageCredentialsInterface interface { // // Gets a list of all storage credentials that have been assigned to given // metastore. - List(ctx context.Context, request ListAccountStorageCredentialsRequest) ([]StorageCredentialInfo, error) - - // StorageCredentialInfoNameToIdMap calls [AccountStorageCredentialsAPI.List] and creates a map of results with [StorageCredentialInfo].Name as key and [StorageCredentialInfo].Id as value. - // - // Returns an error if there's more than one [StorageCredentialInfo] with the same .Name. - // - // Note: All [StorageCredentialInfo] instances are loaded into memory before creating a map. // // This method is generated by Databricks SDK Code Generator. - StorageCredentialInfoNameToIdMap(ctx context.Context, request ListAccountStorageCredentialsRequest) (map[string]string, error) + List(ctx context.Context, request ListAccountStorageCredentialsRequest) listing.Iterator[StorageCredentialInfo] - // GetByName calls [AccountStorageCredentialsAPI.StorageCredentialInfoNameToIdMap] and returns a single [StorageCredentialInfo]. - // - // Returns an error if there's more than one [StorageCredentialInfo] with the same .Name. + // Get all storage credentials assigned to a metastore. // - // Note: All [StorageCredentialInfo] instances are loaded into memory before returning matching by name. + // Gets a list of all storage credentials that have been assigned to given + // metastore. // // This method is generated by Databricks SDK Code Generator. - GetByName(ctx context.Context, name string) (*StorageCredentialInfo, error) + ListAll(ctx context.Context, request ListAccountStorageCredentialsRequest) ([]StorageCredentialInfo, error) // Get all storage credentials assigned to a metastore. // // Gets a list of all storage credentials that have been assigned to given // metastore. - ListByMetastoreId(ctx context.Context, metastoreId string) ([]StorageCredentialInfo, error) + ListByMetastoreId(ctx context.Context, metastoreId string) (*ListAccountStorageCredentialsResponse, error) // Updates a storage credential. // @@ -552,68 +544,42 @@ func (a *AccountStorageCredentialsAPI) GetByMetastoreIdAndStorageCredentialName( // // Gets a list of all storage credentials that have been assigned to given // metastore. -func (a *AccountStorageCredentialsAPI) List(ctx context.Context, request ListAccountStorageCredentialsRequest) ([]StorageCredentialInfo, error) { - return a.impl.List(ctx, request) -} - -// StorageCredentialInfoNameToIdMap calls [AccountStorageCredentialsAPI.List] and creates a map of results with [StorageCredentialInfo].Name as key and [StorageCredentialInfo].Id as value. -// -// Returns an error if there's more than one [StorageCredentialInfo] with the same .Name. -// -// Note: All [StorageCredentialInfo] instances are loaded into memory before creating a map. // // This method is generated by Databricks SDK Code Generator. -func (a *AccountStorageCredentialsAPI) StorageCredentialInfoNameToIdMap(ctx context.Context, request ListAccountStorageCredentialsRequest) (map[string]string, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "name-to-id") - mapping := map[string]string{} - result, err := a.List(ctx, request) - if err != nil { - return nil, err +func (a *AccountStorageCredentialsAPI) List(ctx context.Context, request ListAccountStorageCredentialsRequest) listing.Iterator[StorageCredentialInfo] { + + getNextPage := func(ctx context.Context, req ListAccountStorageCredentialsRequest) (*ListAccountStorageCredentialsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.List(ctx, req) } - for _, v := range result { - key := v.Name - _, duplicate := mapping[key] - if duplicate { - return nil, fmt.Errorf("duplicate .Name: %s", key) - } - mapping[key] = v.Id + getItems := func(resp *ListAccountStorageCredentialsResponse) []StorageCredentialInfo { + return resp.StorageCredentials } - return mapping, nil + + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + nil) + return iterator } -// GetByName calls [AccountStorageCredentialsAPI.StorageCredentialInfoNameToIdMap] and returns a single [StorageCredentialInfo]. -// -// Returns an error if there's more than one [StorageCredentialInfo] with the same .Name. +// Get all storage credentials assigned to a metastore. // -// Note: All [StorageCredentialInfo] instances are loaded into memory before returning matching by name. +// Gets a list of all storage credentials that have been assigned to given +// metastore. // // This method is generated by Databricks SDK Code Generator. -func (a *AccountStorageCredentialsAPI) GetByName(ctx context.Context, name string) (*StorageCredentialInfo, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "get-by-name") - result, err := a.List(ctx, ListAccountStorageCredentialsRequest{}) - if err != nil { - return nil, err - } - tmp := map[string][]StorageCredentialInfo{} - for _, v := range result { - key := v.Name - tmp[key] = append(tmp[key], v) - } - alternatives, ok := tmp[name] - if !ok || len(alternatives) == 0 { - return nil, fmt.Errorf("StorageCredentialInfo named '%s' does not exist", name) - } - if len(alternatives) > 1 { - return nil, fmt.Errorf("there are %d instances of StorageCredentialInfo named '%s'", len(alternatives), name) - } - return &alternatives[0], nil +func (a *AccountStorageCredentialsAPI) ListAll(ctx context.Context, request ListAccountStorageCredentialsRequest) ([]StorageCredentialInfo, error) { + iterator := a.List(ctx, request) + return listing.ToSlice[StorageCredentialInfo](ctx, iterator) } // Get all storage credentials assigned to a metastore. // // Gets a list of all storage credentials that have been assigned to given // metastore. -func (a *AccountStorageCredentialsAPI) ListByMetastoreId(ctx context.Context, metastoreId string) ([]StorageCredentialInfo, error) { +func (a *AccountStorageCredentialsAPI) ListByMetastoreId(ctx context.Context, metastoreId string) (*ListAccountStorageCredentialsResponse, error) { return a.impl.List(ctx, ListAccountStorageCredentialsRequest{ MetastoreId: metastoreId, }) diff --git a/service/catalog/impl.go b/service/catalog/impl.go index b9e6905be..312d9522c 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -147,13 +147,13 @@ func (a *accountStorageCredentialsImpl) Get(ctx context.Context, request GetAcco return &accountsStorageCredentialInfo, err } -func (a *accountStorageCredentialsImpl) List(ctx context.Context, request ListAccountStorageCredentialsRequest) ([]StorageCredentialInfo, error) { - var storageCredentialInfoList []StorageCredentialInfo +func (a *accountStorageCredentialsImpl) List(ctx context.Context, request ListAccountStorageCredentialsRequest) (*ListAccountStorageCredentialsResponse, error) { + var listAccountStorageCredentialsResponse ListAccountStorageCredentialsResponse path := fmt.Sprintf("/api/2.0/accounts/%v/metastores/%v/storage-credentials", a.client.ConfiguredAccountID(), request.MetastoreId) headers := make(map[string]string) headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &storageCredentialInfoList) - return storageCredentialInfoList, err + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listAccountStorageCredentialsResponse) + return &listAccountStorageCredentialsResponse, err } func (a *accountStorageCredentialsImpl) Update(ctx context.Context, request AccountsUpdateStorageCredential) (*AccountsStorageCredentialInfo, error) { diff --git a/service/catalog/interface.go b/service/catalog/interface.go index 170b8f656..f5c406a46 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -108,7 +108,9 @@ type AccountStorageCredentialsService interface { // // Gets a list of all storage credentials that have been assigned to given // metastore. - List(ctx context.Context, request ListAccountStorageCredentialsRequest) ([]StorageCredentialInfo, error) + // + // Use ListAll() to get all StorageCredentialInfo instances + List(ctx context.Context, request ListAccountStorageCredentialsRequest) (*ListAccountStorageCredentialsResponse, error) // Updates a storage credential. // diff --git a/service/catalog/model.go b/service/catalog/model.go index 6298e532b..8a25042f3 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -1179,22 +1179,50 @@ type DataSourceFormat string const DataSourceFormatAvro DataSourceFormat = `AVRO` +const DataSourceFormatBigqueryFormat DataSourceFormat = `BIGQUERY_FORMAT` + const DataSourceFormatCsv DataSourceFormat = `CSV` +const DataSourceFormatDatabricksFormat DataSourceFormat = `DATABRICKS_FORMAT` + const DataSourceFormatDelta DataSourceFormat = `DELTA` const DataSourceFormatDeltasharing DataSourceFormat = `DELTASHARING` +const DataSourceFormatHiveCustom DataSourceFormat = `HIVE_CUSTOM` + +const DataSourceFormatHiveSerde DataSourceFormat = `HIVE_SERDE` + const DataSourceFormatJson DataSourceFormat = `JSON` +const DataSourceFormatMysqlFormat DataSourceFormat = `MYSQL_FORMAT` + +const DataSourceFormatNetsuiteFormat DataSourceFormat = `NETSUITE_FORMAT` + const DataSourceFormatOrc DataSourceFormat = `ORC` const DataSourceFormatParquet DataSourceFormat = `PARQUET` +const DataSourceFormatPostgresqlFormat DataSourceFormat = `POSTGRESQL_FORMAT` + +const DataSourceFormatRedshiftFormat DataSourceFormat = `REDSHIFT_FORMAT` + +const DataSourceFormatSalesforceFormat DataSourceFormat = `SALESFORCE_FORMAT` + +const DataSourceFormatSnowflakeFormat DataSourceFormat = `SNOWFLAKE_FORMAT` + +const DataSourceFormatSqldwFormat DataSourceFormat = `SQLDW_FORMAT` + +const DataSourceFormatSqlserverFormat DataSourceFormat = `SQLSERVER_FORMAT` + const DataSourceFormatText DataSourceFormat = `TEXT` const DataSourceFormatUnityCatalog DataSourceFormat = `UNITY_CATALOG` +const DataSourceFormatVectorIndexFormat DataSourceFormat = `VECTOR_INDEX_FORMAT` + +const DataSourceFormatWorkdayRaasFormat DataSourceFormat = `WORKDAY_RAAS_FORMAT` + // String representation for [fmt.Print] func (f *DataSourceFormat) String() string { return string(*f) @@ -1203,11 +1231,11 @@ func (f *DataSourceFormat) String() string { // Set raw string value and validate it against allowed values func (f *DataSourceFormat) Set(v string) error { switch v { - case `AVRO`, `CSV`, `DELTA`, `DELTASHARING`, `JSON`, `ORC`, `PARQUET`, `TEXT`, `UNITY_CATALOG`: + case `AVRO`, `BIGQUERY_FORMAT`, `CSV`, `DATABRICKS_FORMAT`, `DELTA`, `DELTASHARING`, `HIVE_CUSTOM`, `HIVE_SERDE`, `JSON`, `MYSQL_FORMAT`, `NETSUITE_FORMAT`, `ORC`, `PARQUET`, `POSTGRESQL_FORMAT`, `REDSHIFT_FORMAT`, `SALESFORCE_FORMAT`, `SNOWFLAKE_FORMAT`, `SQLDW_FORMAT`, `SQLSERVER_FORMAT`, `TEXT`, `UNITY_CATALOG`, `VECTOR_INDEX_FORMAT`, `WORKDAY_RAAS_FORMAT`: *f = DataSourceFormat(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "AVRO", "CSV", "DELTA", "DELTASHARING", "JSON", "ORC", "PARQUET", "TEXT", "UNITY_CATALOG"`, v) + return fmt.Errorf(`value "%s" is not one of "AVRO", "BIGQUERY_FORMAT", "CSV", "DATABRICKS_FORMAT", "DELTA", "DELTASHARING", "HIVE_CUSTOM", "HIVE_SERDE", "JSON", "MYSQL_FORMAT", "NETSUITE_FORMAT", "ORC", "PARQUET", "POSTGRESQL_FORMAT", "REDSHIFT_FORMAT", "SALESFORCE_FORMAT", "SNOWFLAKE_FORMAT", "SQLDW_FORMAT", "SQLSERVER_FORMAT", "TEXT", "UNITY_CATALOG", "VECTOR_INDEX_FORMAT", "WORKDAY_RAAS_FORMAT"`, v) } } @@ -2408,6 +2436,11 @@ type ListAccountStorageCredentialsRequest struct { MetastoreId string `json:"-" url:"-"` } +type ListAccountStorageCredentialsResponse struct { + // An array of metastore storage credentials. + StorageCredentials []StorageCredentialInfo `json:"storage_credentials,omitempty"` +} + // List catalogs type ListCatalogsRequest struct { // Whether to include catalogs in the response for which the principal can @@ -4474,8 +4507,14 @@ type TableType string const TableTypeExternal TableType = `EXTERNAL` +const TableTypeExternalShallowClone TableType = `EXTERNAL_SHALLOW_CLONE` + +const TableTypeForeign TableType = `FOREIGN` + const TableTypeManaged TableType = `MANAGED` +const TableTypeManagedShallowClone TableType = `MANAGED_SHALLOW_CLONE` + const TableTypeMaterializedView TableType = `MATERIALIZED_VIEW` const TableTypeStreamingTable TableType = `STREAMING_TABLE` @@ -4490,11 +4529,11 @@ func (f *TableType) String() string { // Set raw string value and validate it against allowed values func (f *TableType) Set(v string) error { switch v { - case `EXTERNAL`, `MANAGED`, `MATERIALIZED_VIEW`, `STREAMING_TABLE`, `VIEW`: + case `EXTERNAL`, `EXTERNAL_SHALLOW_CLONE`, `FOREIGN`, `MANAGED`, `MANAGED_SHALLOW_CLONE`, `MATERIALIZED_VIEW`, `STREAMING_TABLE`, `VIEW`: *f = TableType(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "EXTERNAL", "MANAGED", "MATERIALIZED_VIEW", "STREAMING_TABLE", "VIEW"`, v) + return fmt.Errorf(`value "%s" is not one of "EXTERNAL", "EXTERNAL_SHALLOW_CLONE", "FOREIGN", "MANAGED", "MANAGED_SHALLOW_CLONE", "MATERIALIZED_VIEW", "STREAMING_TABLE", "VIEW"`, v) } } diff --git a/service/compute/model.go b/service/compute/model.go index f849f7998..354002147 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -455,7 +455,8 @@ type ClusterAttributes struct { // ACL clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating // from legacy Passthrough on high concurrency clusters. * // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - // Passthrough on standard clusters. + // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This + // mode provides a way that doesn’t have UC nor passthrough enabled. DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` DockerImage *DockerImage `json:"docker_image,omitempty"` @@ -613,7 +614,8 @@ type ClusterDetails struct { // ACL clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating // from legacy Passthrough on high concurrency clusters. * // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - // Passthrough on standard clusters. + // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This + // mode provides a way that doesn’t have UC nor passthrough enabled. DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` // Tags that are added by Databricks regardless of any `custom_tags`, // including: @@ -1156,7 +1158,8 @@ type ClusterSpec struct { // ACL clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating // from legacy Passthrough on high concurrency clusters. * // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - // Passthrough on standard clusters. + // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This + // mode provides a way that doesn’t have UC nor passthrough enabled. DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` DockerImage *DockerImage `json:"docker_image,omitempty"` @@ -1455,7 +1458,8 @@ type CreateCluster struct { // ACL clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating // from legacy Passthrough on high concurrency clusters. * // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - // Passthrough on standard clusters. + // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This + // mode provides a way that doesn’t have UC nor passthrough enabled. DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` DockerImage *DockerImage `json:"docker_image,omitempty"` @@ -1821,7 +1825,9 @@ func (f *DataPlaneEventDetailsEventType) Type() string { // * `LEGACY_TABLE_ACL`: This mode is for users migrating from legacy Table ACL // clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating from // legacy Passthrough on high concurrency clusters. * `LEGACY_SINGLE_USER`: This -// mode is for users migrating from legacy Passthrough on standard clusters. +// mode is for users migrating from legacy Passthrough on standard clusters. * +// `LEGACY_SINGLE_USER_STANDARD`: This mode provides a way that doesn’t have +// UC nor passthrough enabled. type DataSecurityMode string // This mode is for users migrating from legacy Passthrough on high concurrency @@ -1832,6 +1838,9 @@ const DataSecurityModeLegacyPassthrough DataSecurityMode = `LEGACY_PASSTHROUGH` // clusters. const DataSecurityModeLegacySingleUser DataSecurityMode = `LEGACY_SINGLE_USER` +// This mode provides a way that doesn’t have UC nor passthrough enabled. +const DataSecurityModeLegacySingleUserStandard DataSecurityMode = `LEGACY_SINGLE_USER_STANDARD` + // This mode is for users migrating from legacy Table ACL clusters. const DataSecurityModeLegacyTableAcl DataSecurityMode = `LEGACY_TABLE_ACL` @@ -1858,11 +1867,11 @@ func (f *DataSecurityMode) String() string { // Set raw string value and validate it against allowed values func (f *DataSecurityMode) Set(v string) error { switch v { - case `LEGACY_PASSTHROUGH`, `LEGACY_SINGLE_USER`, `LEGACY_TABLE_ACL`, `NONE`, `SINGLE_USER`, `USER_ISOLATION`: + case `LEGACY_PASSTHROUGH`, `LEGACY_SINGLE_USER`, `LEGACY_SINGLE_USER_STANDARD`, `LEGACY_TABLE_ACL`, `NONE`, `SINGLE_USER`, `USER_ISOLATION`: *f = DataSecurityMode(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"`, v) + return fmt.Errorf(`value "%s" is not one of "LEGACY_PASSTHROUGH", "LEGACY_SINGLE_USER", "LEGACY_SINGLE_USER_STANDARD", "LEGACY_TABLE_ACL", "NONE", "SINGLE_USER", "USER_ISOLATION"`, v) } } @@ -2146,7 +2155,8 @@ type EditCluster struct { // ACL clusters. * `LEGACY_PASSTHROUGH`: This mode is for users migrating // from legacy Passthrough on high concurrency clusters. * // `LEGACY_SINGLE_USER`: This mode is for users migrating from legacy - // Passthrough on standard clusters. + // Passthrough on standard clusters. * `LEGACY_SINGLE_USER_STANDARD`: This + // mode provides a way that doesn’t have UC nor passthrough enabled. DataSecurityMode DataSecurityMode `json:"data_security_mode,omitempty"` DockerImage *DockerImage `json:"docker_image,omitempty"` diff --git a/service/jobs/model.go b/service/jobs/model.go index 5fc900323..3981a1f18 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -650,6 +650,8 @@ type ForEachTaskErrorMessageStats struct { Count int `json:"count,omitempty"` // Describes the error message occured during the iterations. ErrorMessage string `json:"error_message,omitempty"` + // Describes the termination reason for the error message. + TerminationCategory string `json:"termination_category,omitempty"` ForceSendFields []string `json:"-"` } diff --git a/service/marketplace/api.go b/service/marketplace/api.go index d6ea7e048..818448571 100755 --- a/service/marketplace/api.go +++ b/service/marketplace/api.go @@ -440,6 +440,12 @@ type ConsumerListingsInterface interface { // Deprecated: use MockConsumerListingsInterface instead. Impl() ConsumerListingsService + // Get one batch of listings. One may specify up to 50 IDs per request. + // + // Batch get a published listing in the Databricks Marketplace that the consumer + // has access to. + BatchGet(ctx context.Context, request BatchGetListingsRequest) (*BatchGetListingsResponse, error) + // Get listing. // // Get a published listing in the Databricks Marketplace that the consumer has @@ -535,6 +541,14 @@ func (a *ConsumerListingsAPI) Impl() ConsumerListingsService { return a.impl } +// Get one batch of listings. One may specify up to 50 IDs per request. +// +// Batch get a published listing in the Databricks Marketplace that the consumer +// has access to. +func (a *ConsumerListingsAPI) BatchGet(ctx context.Context, request BatchGetListingsRequest) (*BatchGetListingsResponse, error) { + return a.impl.BatchGet(ctx, request) +} + // Get listing. // // Get a published listing in the Databricks Marketplace that the consumer has @@ -836,6 +850,12 @@ type ConsumerProvidersInterface interface { // Deprecated: use MockConsumerProvidersInterface instead. Impl() ConsumerProvidersService + // Get one batch of providers. One may specify up to 50 IDs per request. + // + // Batch get a provider in the Databricks Marketplace with at least one visible + // listing. + BatchGet(ctx context.Context, request BatchGetProvidersRequest) (*BatchGetProvidersResponse, error) + // Get a provider. // // Get a provider in the Databricks Marketplace with at least one visible @@ -912,6 +932,14 @@ func (a *ConsumerProvidersAPI) Impl() ConsumerProvidersService { return a.impl } +// Get one batch of providers. One may specify up to 50 IDs per request. +// +// Batch get a provider in the Databricks Marketplace with at least one visible +// listing. +func (a *ConsumerProvidersAPI) BatchGet(ctx context.Context, request BatchGetProvidersRequest) (*BatchGetProvidersResponse, error) { + return a.impl.BatchGet(ctx, request) +} + // Get a provider. // // Get a provider in the Databricks Marketplace with at least one visible diff --git a/service/marketplace/impl.go b/service/marketplace/impl.go index a9c85828e..81072eec0 100755 --- a/service/marketplace/impl.go +++ b/service/marketplace/impl.go @@ -90,6 +90,15 @@ type consumerListingsImpl struct { client *client.DatabricksClient } +func (a *consumerListingsImpl) BatchGet(ctx context.Context, request BatchGetListingsRequest) (*BatchGetListingsResponse, error) { + var batchGetListingsResponse BatchGetListingsResponse + path := "/api/2.1/marketplace-consumer/listings:batchGet" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &batchGetListingsResponse) + return &batchGetListingsResponse, err +} + func (a *consumerListingsImpl) Get(ctx context.Context, request GetListingRequest) (*GetListingResponse, error) { var getListingResponse GetListingResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/listings/%v", request.Id) @@ -155,6 +164,15 @@ type consumerProvidersImpl struct { client *client.DatabricksClient } +func (a *consumerProvidersImpl) BatchGet(ctx context.Context, request BatchGetProvidersRequest) (*BatchGetProvidersResponse, error) { + var batchGetProvidersResponse BatchGetProvidersResponse + path := "/api/2.1/marketplace-consumer/providers:batchGet" + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &batchGetProvidersResponse) + return &batchGetProvidersResponse, err +} + func (a *consumerProvidersImpl) Get(ctx context.Context, request GetProviderRequest) (*GetProviderResponse, error) { var getProviderResponse GetProviderResponse path := fmt.Sprintf("/api/2.1/marketplace-consumer/providers/%v", request.Id) diff --git a/service/marketplace/interface.go b/service/marketplace/interface.go index 51263c1e9..ca7e60b7c 100755 --- a/service/marketplace/interface.go +++ b/service/marketplace/interface.go @@ -72,6 +72,12 @@ type ConsumerInstallationsService interface { // products that are available for consumption. type ConsumerListingsService interface { + // Get one batch of listings. One may specify up to 50 IDs per request. + // + // Batch get a published listing in the Databricks Marketplace that the + // consumer has access to. + BatchGet(ctx context.Context, request BatchGetListingsRequest) (*BatchGetListingsResponse, error) + // Get listing. // // Get a published listing in the Databricks Marketplace that the consumer @@ -122,6 +128,12 @@ type ConsumerPersonalizationRequestsService interface { // Providers are the entities that publish listings to the Marketplace. type ConsumerProvidersService interface { + // Get one batch of providers. One may specify up to 50 IDs per request. + // + // Batch get a provider in the Databricks Marketplace with at least one + // visible listing. + BatchGet(ctx context.Context, request BatchGetProvidersRequest) (*BatchGetProvidersResponse, error) + // Get a provider. // // Get a provider in the Databricks Marketplace with at least one visible diff --git a/service/marketplace/model.go b/service/marketplace/model.go index 5c1045d5d..efc78aa57 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -53,6 +53,24 @@ func (f *AssetType) Type() string { return "AssetType" } +// Get one batch of listings. One may specify up to 50 IDs per request. +type BatchGetListingsRequest struct { + Ids []string `json:"-" url:"ids,omitempty"` +} + +type BatchGetListingsResponse struct { + Listings []Listing `json:"listings,omitempty"` +} + +// Get one batch of providers. One may specify up to 50 IDs per request. +type BatchGetProvidersRequest struct { + Ids []string `json:"-" url:"ids,omitempty"` +} + +type BatchGetProvidersResponse struct { + Providers []ProviderInfo `json:"providers,omitempty"` +} + type Category string const CategoryAdvertisingAndMarketing Category = `ADVERTISING_AND_MARKETING` diff --git a/service/oauth2/model.go b/service/oauth2/model.go index defc930e2..b313af902 100755 --- a/service/oauth2/model.go +++ b/service/oauth2/model.go @@ -114,6 +114,23 @@ func (s CreateServicePrincipalSecretResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type DataPlaneInfo struct { + // Authorization details as a string. + AuthorizationDetails string `json:"authorization_details,omitempty"` + // The URL of the endpoint for this operation in the dataplane. + EndpointUrl string `json:"endpoint_url,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *DataPlaneInfo) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DataPlaneInfo) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type DeleteCustomAppIntegrationOutput struct { } diff --git a/service/serving/api.go b/service/serving/api.go index 2771bdba0..64e30bc0d 100755 --- a/service/serving/api.go +++ b/service/serving/api.go @@ -32,7 +32,7 @@ type AppsInterface interface { WaitGetDeploymentAppSucceeded(ctx context.Context, appName string, deploymentId string, timeout time.Duration, callback func(*AppDeployment)) (*AppDeployment, error) - // Create an App. + // Create an app. // // Creates a new app. Create(ctx context.Context, createAppRequest CreateAppRequest) (*WaitGetAppIdle[App], error) @@ -45,100 +45,100 @@ type AppsInterface interface { // Deprecated: use [AppsAPIInterface.Create].Get() or [AppsAPIInterface.WaitGetAppIdle] CreateAndWait(ctx context.Context, createAppRequest CreateAppRequest, options ...retries.Option[App]) (*App, error) - // Create an App Deployment. - // - // Creates an app deployment for the app with the supplied name. - CreateDeployment(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest) (*WaitGetDeploymentAppSucceeded[AppDeployment], error) - - // Calls [AppsAPIInterface.CreateDeployment] and waits to reach SUCCEEDED state - // - // You can override the default timeout of 20 minutes by calling adding - // retries.Timeout[AppDeployment](60*time.Minute) functional option. - // - // Deprecated: use [AppsAPIInterface.CreateDeployment].Get() or [AppsAPIInterface.WaitGetDeploymentAppSucceeded] - CreateDeploymentAndWait(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest, options ...retries.Option[AppDeployment]) (*AppDeployment, error) - - // Delete an App. + // Delete an app. // // Deletes an app. Delete(ctx context.Context, request DeleteAppRequest) error - // Delete an App. + // Delete an app. // // Deletes an app. DeleteByName(ctx context.Context, name string) error - // Get an App. + // Create an app deployment. + // + // Creates an app deployment for the app with the supplied name. + Deploy(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest) (*WaitGetDeploymentAppSucceeded[AppDeployment], error) + + // Calls [AppsAPIInterface.Deploy] and waits to reach SUCCEEDED state + // + // You can override the default timeout of 20 minutes by calling adding + // retries.Timeout[AppDeployment](60*time.Minute) functional option. + // + // Deprecated: use [AppsAPIInterface.Deploy].Get() or [AppsAPIInterface.WaitGetDeploymentAppSucceeded] + DeployAndWait(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest, options ...retries.Option[AppDeployment]) (*AppDeployment, error) + + // Get an app. // // Retrieves information for the app with the supplied name. Get(ctx context.Context, request GetAppRequest) (*App, error) - // Get an App. + // Get an app. // // Retrieves information for the app with the supplied name. GetByName(ctx context.Context, name string) (*App, error) - // Get an App Deployment. + // Get an app deployment. // // Retrieves information for the app deployment with the supplied name and // deployment id. GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error) - // Get an App Deployment. + // Get an app deployment. // // Retrieves information for the app deployment with the supplied name and // deployment id. GetDeploymentByAppNameAndDeploymentId(ctx context.Context, appName string, deploymentId string) (*AppDeployment, error) - // Get App Environment. + // Get app environment. // // Retrieves app environment. GetEnvironment(ctx context.Context, request GetAppEnvironmentRequest) (*AppEnvironment, error) - // Get App Environment. + // Get app environment. // // Retrieves app environment. GetEnvironmentByName(ctx context.Context, name string) (*AppEnvironment, error) - // List Apps. + // List apps. // // Lists all apps in the workspace. // // This method is generated by Databricks SDK Code Generator. List(ctx context.Context, request ListAppsRequest) listing.Iterator[App] - // List Apps. + // List apps. // // Lists all apps in the workspace. // // This method is generated by Databricks SDK Code Generator. ListAll(ctx context.Context, request ListAppsRequest) ([]App, error) - // List App Deployments. + // List app deployments. // // Lists all app deployments for the app with the supplied name. // // This method is generated by Databricks SDK Code Generator. ListDeployments(ctx context.Context, request ListAppDeploymentsRequest) listing.Iterator[AppDeployment] - // List App Deployments. + // List app deployments. // // Lists all app deployments for the app with the supplied name. // // This method is generated by Databricks SDK Code Generator. ListDeploymentsAll(ctx context.Context, request ListAppDeploymentsRequest) ([]AppDeployment, error) - // List App Deployments. + // List app deployments. // // Lists all app deployments for the app with the supplied name. ListDeploymentsByAppName(ctx context.Context, appName string) (*ListAppDeploymentsResponse, error) - // Stop an App. + // Stop an app. // // Stops the active deployment of the app in the workspace. Stop(ctx context.Context, request StopAppRequest) error - // Update an App. + // Update an app. // // Updates the app with the supplied name. Update(ctx context.Context, request UpdateAppRequest) (*App, error) @@ -291,7 +291,7 @@ func (w *WaitGetDeploymentAppSucceeded[R]) GetWithTimeout(timeout time.Duration) return w.Poll(timeout, w.callback) } -// Create an App. +// Create an app. // // Creates a new app. func (a *AppsAPI) Create(ctx context.Context, createAppRequest CreateAppRequest) (*WaitGetAppIdle[App], error) { @@ -337,11 +337,27 @@ func (a *AppsAPI) CreateAndWait(ctx context.Context, createAppRequest CreateAppR return wait.Get() } -// Create an App Deployment. +// Delete an app. +// +// Deletes an app. +func (a *AppsAPI) Delete(ctx context.Context, request DeleteAppRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete an app. +// +// Deletes an app. +func (a *AppsAPI) DeleteByName(ctx context.Context, name string) error { + return a.impl.Delete(ctx, DeleteAppRequest{ + Name: name, + }) +} + +// Create an app deployment. // // Creates an app deployment for the app with the supplied name. -func (a *AppsAPI) CreateDeployment(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest) (*WaitGetDeploymentAppSucceeded[AppDeployment], error) { - appDeployment, err := a.impl.CreateDeployment(ctx, createAppDeploymentRequest) +func (a *AppsAPI) Deploy(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest) (*WaitGetDeploymentAppSucceeded[AppDeployment], error) { + appDeployment, err := a.impl.Deploy(ctx, createAppDeploymentRequest) if err != nil { return nil, err } @@ -357,14 +373,14 @@ func (a *AppsAPI) CreateDeployment(ctx context.Context, createAppDeploymentReque }, nil } -// Calls [AppsAPI.CreateDeployment] and waits to reach SUCCEEDED state +// Calls [AppsAPI.Deploy] and waits to reach SUCCEEDED state // // You can override the default timeout of 20 minutes by calling adding // retries.Timeout[AppDeployment](60*time.Minute) functional option. // -// Deprecated: use [AppsAPI.CreateDeployment].Get() or [AppsAPI.WaitGetDeploymentAppSucceeded] -func (a *AppsAPI) CreateDeploymentAndWait(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest, options ...retries.Option[AppDeployment]) (*AppDeployment, error) { - wait, err := a.CreateDeployment(ctx, createAppDeploymentRequest) +// Deprecated: use [AppsAPI.Deploy].Get() or [AppsAPI.WaitGetDeploymentAppSucceeded] +func (a *AppsAPI) DeployAndWait(ctx context.Context, createAppDeploymentRequest CreateAppDeploymentRequest, options ...retries.Option[AppDeployment]) (*AppDeployment, error) { + wait, err := a.Deploy(ctx, createAppDeploymentRequest) if err != nil { return nil, err } @@ -384,30 +400,14 @@ func (a *AppsAPI) CreateDeploymentAndWait(ctx context.Context, createAppDeployme return wait.Get() } -// Delete an App. -// -// Deletes an app. -func (a *AppsAPI) Delete(ctx context.Context, request DeleteAppRequest) error { - return a.impl.Delete(ctx, request) -} - -// Delete an App. -// -// Deletes an app. -func (a *AppsAPI) DeleteByName(ctx context.Context, name string) error { - return a.impl.Delete(ctx, DeleteAppRequest{ - Name: name, - }) -} - -// Get an App. +// Get an app. // // Retrieves information for the app with the supplied name. func (a *AppsAPI) Get(ctx context.Context, request GetAppRequest) (*App, error) { return a.impl.Get(ctx, request) } -// Get an App. +// Get an app. // // Retrieves information for the app with the supplied name. func (a *AppsAPI) GetByName(ctx context.Context, name string) (*App, error) { @@ -416,7 +416,7 @@ func (a *AppsAPI) GetByName(ctx context.Context, name string) (*App, error) { }) } -// Get an App Deployment. +// Get an app deployment. // // Retrieves information for the app deployment with the supplied name and // deployment id. @@ -424,7 +424,7 @@ func (a *AppsAPI) GetDeployment(ctx context.Context, request GetAppDeploymentReq return a.impl.GetDeployment(ctx, request) } -// Get an App Deployment. +// Get an app deployment. // // Retrieves information for the app deployment with the supplied name and // deployment id. @@ -435,14 +435,14 @@ func (a *AppsAPI) GetDeploymentByAppNameAndDeploymentId(ctx context.Context, app }) } -// Get App Environment. +// Get app environment. // // Retrieves app environment. func (a *AppsAPI) GetEnvironment(ctx context.Context, request GetAppEnvironmentRequest) (*AppEnvironment, error) { return a.impl.GetEnvironment(ctx, request) } -// Get App Environment. +// Get app environment. // // Retrieves app environment. func (a *AppsAPI) GetEnvironmentByName(ctx context.Context, name string) (*AppEnvironment, error) { @@ -451,7 +451,7 @@ func (a *AppsAPI) GetEnvironmentByName(ctx context.Context, name string) (*AppEn }) } -// List Apps. +// List apps. // // Lists all apps in the workspace. // @@ -480,7 +480,7 @@ func (a *AppsAPI) List(ctx context.Context, request ListAppsRequest) listing.Ite return iterator } -// List Apps. +// List apps. // // Lists all apps in the workspace. // @@ -490,7 +490,7 @@ func (a *AppsAPI) ListAll(ctx context.Context, request ListAppsRequest) ([]App, return listing.ToSlice[App](ctx, iterator) } -// List App Deployments. +// List app deployments. // // Lists all app deployments for the app with the supplied name. // @@ -519,7 +519,7 @@ func (a *AppsAPI) ListDeployments(ctx context.Context, request ListAppDeployment return iterator } -// List App Deployments. +// List app deployments. // // Lists all app deployments for the app with the supplied name. // @@ -529,7 +529,7 @@ func (a *AppsAPI) ListDeploymentsAll(ctx context.Context, request ListAppDeploym return listing.ToSlice[AppDeployment](ctx, iterator) } -// List App Deployments. +// List app deployments. // // Lists all app deployments for the app with the supplied name. func (a *AppsAPI) ListDeploymentsByAppName(ctx context.Context, appName string) (*ListAppDeploymentsResponse, error) { @@ -538,14 +538,14 @@ func (a *AppsAPI) ListDeploymentsByAppName(ctx context.Context, appName string) }) } -// Stop an App. +// Stop an app. // // Stops the active deployment of the app in the workspace. func (a *AppsAPI) Stop(ctx context.Context, request StopAppRequest) error { return a.impl.Stop(ctx, request) } -// Update an App. +// Update an app. // // Updates the app with the supplied name. func (a *AppsAPI) Update(ctx context.Context, request UpdateAppRequest) (*App, error) { diff --git a/service/serving/impl.go b/service/serving/impl.go index bbaee1b8f..c267d2002 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -25,16 +25,6 @@ func (a *appsImpl) Create(ctx context.Context, request CreateAppRequest) (*App, return &app, err } -func (a *appsImpl) CreateDeployment(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error) { - var appDeployment AppDeployment - path := fmt.Sprintf("/api/2.0/preview/apps/%v/deployments", request.AppName) - headers := make(map[string]string) - headers["Accept"] = "application/json" - headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &appDeployment) - return &appDeployment, err -} - func (a *appsImpl) Delete(ctx context.Context, request DeleteAppRequest) error { var deleteResponse DeleteResponse path := fmt.Sprintf("/api/2.0/preview/apps/%v", request.Name) @@ -44,6 +34,16 @@ func (a *appsImpl) Delete(ctx context.Context, request DeleteAppRequest) error { return err } +func (a *appsImpl) Deploy(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error) { + var appDeployment AppDeployment + path := fmt.Sprintf("/api/2.0/preview/apps/%v/deployments", request.AppName) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &appDeployment) + return &appDeployment, err +} + func (a *appsImpl) Get(ctx context.Context, request GetAppRequest) (*App, error) { var app App path := fmt.Sprintf("/api/2.0/preview/apps/%v", request.Name) diff --git a/service/serving/interface.go b/service/serving/interface.go index 6ee7f076f..61350c543 100755 --- a/service/serving/interface.go +++ b/service/serving/interface.go @@ -11,57 +11,57 @@ import ( // through single sign-on. type AppsService interface { - // Create an App. + // Create an app. // // Creates a new app. Create(ctx context.Context, request CreateAppRequest) (*App, error) - // Create an App Deployment. - // - // Creates an app deployment for the app with the supplied name. - CreateDeployment(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error) - - // Delete an App. + // Delete an app. // // Deletes an app. Delete(ctx context.Context, request DeleteAppRequest) error - // Get an App. + // Create an app deployment. + // + // Creates an app deployment for the app with the supplied name. + Deploy(ctx context.Context, request CreateAppDeploymentRequest) (*AppDeployment, error) + + // Get an app. // // Retrieves information for the app with the supplied name. Get(ctx context.Context, request GetAppRequest) (*App, error) - // Get an App Deployment. + // Get an app deployment. // // Retrieves information for the app deployment with the supplied name and // deployment id. GetDeployment(ctx context.Context, request GetAppDeploymentRequest) (*AppDeployment, error) - // Get App Environment. + // Get app environment. // // Retrieves app environment. GetEnvironment(ctx context.Context, request GetAppEnvironmentRequest) (*AppEnvironment, error) - // List Apps. + // List apps. // // Lists all apps in the workspace. // // Use ListAll() to get all App instances, which will iterate over every result page. List(ctx context.Context, request ListAppsRequest) (*ListAppsResponse, error) - // List App Deployments. + // List app deployments. // // Lists all app deployments for the app with the supplied name. // // Use ListDeploymentsAll() to get all AppDeployment instances, which will iterate over every result page. ListDeployments(ctx context.Context, request ListAppDeploymentsRequest) (*ListAppDeploymentsResponse, error) - // Stop an App. + // Stop an app. // // Stops the active deployment of the app in the workspace. Stop(ctx context.Context, request StopAppRequest) error - // Update an App. + // Update an app. // // Updates the app with the supplied name. Update(ctx context.Context, request UpdateAppRequest) (*App, error) diff --git a/service/serving/model.go b/service/serving/model.go index 410e4e8ab..72d976efb 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -7,6 +7,7 @@ import ( "io" "github.com/databricks/databricks-sdk-go/marshal" + "github.com/databricks/databricks-sdk-go/service/oauth2" ) type Ai21LabsConfig struct { @@ -77,8 +78,7 @@ type App struct { // The description of the app. Description string `json:"description,omitempty"` // The name of the app. The name must contain only lowercase alphanumeric - // characters and hyphens and be between 2 and 30 characters long. It must - // be unique within the workspace. + // characters and hyphens. It must be unique within the workspace. Name string `json:"name"` // The pending deployment of the app. PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"` @@ -111,7 +111,15 @@ type AppDeployment struct { DeploymentArtifacts *AppDeploymentArtifacts `json:"deployment_artifacts,omitempty"` // The unique id of the deployment. DeploymentId string `json:"deployment_id,omitempty"` - // The source code path of the deployment. + // The mode of which the deployment will manage the source code. + Mode AppDeploymentMode `json:"mode"` + // The workspace file system path of the source code used to create the app + // deployment. This is different from + // `deployment_artifacts.source_code_path`, which is the path used by the + // deployed app. The former refers to the original source code location of + // the app in the workspace during deployment creation, whereas the latter + // provides a system generated stable snapshotted source code path used by + // the deployment. SourceCodePath string `json:"source_code_path"` // Status and status message of the deployment Status *AppDeploymentStatus `json:"status,omitempty"` @@ -130,7 +138,8 @@ func (s AppDeployment) MarshalJSON() ([]byte, error) { } type AppDeploymentArtifacts struct { - // The source code of the deployment. + // The snapshotted workspace file system path of the source code loaded by + // the deployed app. SourceCodePath string `json:"source_code_path,omitempty"` ForceSendFields []string `json:"-"` @@ -144,9 +153,36 @@ func (s AppDeploymentArtifacts) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type AppDeploymentState string +type AppDeploymentMode string + +const AppDeploymentModeAutoSync AppDeploymentMode = `AUTO_SYNC` + +const AppDeploymentModeModeUnspecified AppDeploymentMode = `MODE_UNSPECIFIED` + +const AppDeploymentModeSnapshot AppDeploymentMode = `SNAPSHOT` + +// String representation for [fmt.Print] +func (f *AppDeploymentMode) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *AppDeploymentMode) Set(v string) error { + switch v { + case `AUTO_SYNC`, `MODE_UNSPECIFIED`, `SNAPSHOT`: + *f = AppDeploymentMode(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "AUTO_SYNC", "MODE_UNSPECIFIED", "SNAPSHOT"`, v) + } +} -const AppDeploymentStateCancelled AppDeploymentState = `CANCELLED` +// Type always returns AppDeploymentMode to satisfy [pflag.Value] interface +func (f *AppDeploymentMode) Type() string { + return "AppDeploymentMode" +} + +type AppDeploymentState string const AppDeploymentStateFailed AppDeploymentState = `FAILED` @@ -166,11 +202,11 @@ func (f *AppDeploymentState) String() string { // Set raw string value and validate it against allowed values func (f *AppDeploymentState) Set(v string) error { switch v { - case `CANCELLED`, `FAILED`, `IN_PROGRESS`, `STATE_UNSPECIFIED`, `STOPPED`, `SUCCEEDED`: + case `FAILED`, `IN_PROGRESS`, `STATE_UNSPECIFIED`, `STOPPED`, `SUCCEEDED`: *f = AppDeploymentState(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CANCELLED", "FAILED", "IN_PROGRESS", "STATE_UNSPECIFIED", "STOPPED", "SUCCEEDED"`, v) + return fmt.Errorf(`value "%s" is not one of "FAILED", "IN_PROGRESS", "STATE_UNSPECIFIED", "STOPPED", "SUCCEEDED"`, v) } } @@ -208,24 +244,16 @@ const AppStateDeleted AppState = `DELETED` const AppStateDeleting AppState = `DELETING` -const AppStateDeployed AppState = `DEPLOYED` - -const AppStateDeploying AppState = `DEPLOYING` - const AppStateError AppState = `ERROR` const AppStateIdle AppState = `IDLE` -const AppStateReady AppState = `READY` - const AppStateRunning AppState = `RUNNING` const AppStateStarting AppState = `STARTING` const AppStateStateUnspecified AppState = `STATE_UNSPECIFIED` -const AppStateUpdating AppState = `UPDATING` - // String representation for [fmt.Print] func (f *AppState) String() string { return string(*f) @@ -234,11 +262,11 @@ func (f *AppState) String() string { // Set raw string value and validate it against allowed values func (f *AppState) Set(v string) error { switch v { - case `CREATING`, `DELETED`, `DELETING`, `DEPLOYED`, `DEPLOYING`, `ERROR`, `IDLE`, `READY`, `RUNNING`, `STARTING`, `STATE_UNSPECIFIED`, `UPDATING`: + case `CREATING`, `DELETED`, `DELETING`, `ERROR`, `IDLE`, `RUNNING`, `STARTING`, `STATE_UNSPECIFIED`: *f = AppState(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CREATING", "DELETED", "DELETING", "DEPLOYED", "DEPLOYING", "ERROR", "IDLE", "READY", "RUNNING", "STARTING", "STATE_UNSPECIFIED", "UPDATING"`, v) + return fmt.Errorf(`value "%s" is not one of "CREATING", "DELETED", "DELETING", "ERROR", "IDLE", "RUNNING", "STARTING", "STATE_UNSPECIFIED"`, v) } } @@ -386,7 +414,15 @@ type CohereConfig struct { type CreateAppDeploymentRequest struct { // The name of the app. AppName string `json:"-" url:"-"` - // The source code path of the deployment. + // The mode of which the deployment will manage the source code. + Mode AppDeploymentMode `json:"mode"` + // The workspace file system path of the source code used to create the app + // deployment. This is different from + // `deployment_artifacts.source_code_path`, which is the path used by the + // deployed app. The former refers to the original source code location of + // the app in the workspace during deployment creation, whereas the latter + // provides a system generated stable snapshotted source code path used by + // the deployment. SourceCodePath string `json:"source_code_path"` } @@ -394,8 +430,7 @@ type CreateAppRequest struct { // The description of the app. Description string `json:"description,omitempty"` // The name of the app. The name must contain only lowercase alphanumeric - // characters and hyphens and be between 2 and 30 characters long. It must - // be unique within the workspace. + // characters and hyphens. It must be unique within the workspace. Name string `json:"name"` ForceSendFields []string `json:"-"` @@ -454,7 +489,7 @@ type DataframeSplitInput struct { Index []int `json:"index,omitempty"` } -// Delete an App +// Delete an app type DeleteAppRequest struct { // The name of the app. Name string `json:"-" url:"-"` @@ -823,7 +858,7 @@ func (s FoundationModel) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Get an App Deployment +// Get an app deployment type GetAppDeploymentRequest struct { // The name of the app. AppName string `json:"-" url:"-"` @@ -831,13 +866,13 @@ type GetAppDeploymentRequest struct { DeploymentId string `json:"-" url:"-"` } -// Get App Environment +// Get app environment type GetAppEnvironmentRequest struct { // The name of the app. Name string `json:"-" url:"-"` } -// Get an App +// Get an app type GetAppRequest struct { // The name of the app. Name string `json:"-" url:"-"` @@ -878,7 +913,7 @@ type GetServingEndpointRequest struct { Name string `json:"-" url:"-"` } -// List App Deployments +// List app deployments type ListAppDeploymentsRequest struct { // The name of the app. AppName string `json:"-" url:"-"` @@ -916,7 +951,7 @@ func (s ListAppDeploymentsResponse) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// List Apps +// List apps type ListAppsRequest struct { // Upper bound for items returned. PageSize int `json:"-" url:"page_size,omitempty"` @@ -966,6 +1001,11 @@ type LogsRequest struct { ServedModelName string `json:"-" url:"-"` } +type ModelDataPlaneInfo struct { + // Information required to query DataPlane API 'query' endpoint. + QueryInfo *oauth2.DataPlaneInfo `json:"query_info,omitempty"` +} + type OpenAiConfig struct { // This field is only required for Azure AD OpenAI and is the Microsoft // Entra Client ID. @@ -1815,6 +1855,8 @@ type ServingEndpointDetailed struct { CreationTimestamp int64 `json:"creation_timestamp,omitempty"` // The email of the user who created the serving endpoint. Creator string `json:"creator,omitempty"` + // Information required to query DataPlane APIs. + DataPlaneInfo *ModelDataPlaneInfo `json:"data_plane_info,omitempty"` // Endpoint invocation url if route optimization is enabled for endpoint EndpointUrl string `json:"endpoint_url,omitempty"` // System-generated ID of the endpoint. This is used to refer to the @@ -1984,8 +2026,7 @@ type UpdateAppRequest struct { // The description of the app. Description string `json:"description,omitempty"` // The name of the app. The name must contain only lowercase alphanumeric - // characters and hyphens and be between 2 and 30 characters long. It must - // be unique within the workspace. + // characters and hyphens. It must be unique within the workspace. Name string `json:"name" url:"-"` ForceSendFields []string `json:"-"` diff --git a/service/sql/model.go b/service/sql/model.go index 431cdbdea..e08608ba1 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -2352,8 +2352,7 @@ type QueryInfo struct { CanSubscribeToLiveQuery bool `json:"canSubscribeToLiveQuery,omitempty"` // Channel information for the SQL warehouse at the time of query execution ChannelUsed *ChannelInfo `json:"channel_used,omitempty"` - // Total execution time of the query from the client’s point of view, in - // milliseconds. + // Total execution time of the statement ( excluding result fetch time ). Duration int `json:"duration,omitempty"` // Alias for `warehouse_id`. EndpointId string `json:"endpoint_id,omitempty"` From 094bca891045d6031c3938584f408592f225d584 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 3 Jun 2024 13:46:42 +0200 Subject: [PATCH 6/8] Release v0.42.0 (#937) * Ignore additional flaky test ([#930](https://github.com/databricks/databricks-sdk-go/pull/930)). * Ignore DataPlane Services during generation ([#933](https://github.com/databricks/databricks-sdk-go/pull/933)). * Update OpenAPI spec ([#934](https://github.com/databricks/databricks-sdk-go/pull/934)). API Changes: * Changed `List` method for [a.AccountStorageCredentials](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AccountStorageCredentialsAPI) account-level service to return [catalog.ListAccountStorageCredentialsResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListAccountStorageCredentialsResponse). * Added [catalog.ListAccountStorageCredentialsResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListAccountStorageCredentialsResponse). * Added `TerminationCategory` field for [jobs.ForEachTaskErrorMessageStats](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#ForEachTaskErrorMessageStats). * Added [oauth2.DataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#DataPlaneInfo). * Removed `CreateDeployment` method for [w.Apps](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppsAPI) workspace-level service. * Added `Deploy` method for [w.Apps](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppsAPI) workspace-level service. * Added `Mode` field for [serving.AppDeployment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppDeployment). * Added `Mode` field for [serving.CreateAppDeploymentRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#CreateAppDeploymentRequest). * Added `DataPlaneInfo` field for [serving.ServingEndpointDetailed](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServingEndpointDetailed). * Added [serving.AppDeploymentMode](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppDeploymentMode). * Added [serving.ModelDataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ModelDataPlaneInfo). OpenAPI SHA: 37b925eba37dfb3d7e05b6ba2d458454ce62d3a0, Date: 2024-06-03 Dependency updates: * Bump golang.org/x/mod from 0.16.0 to 0.17.0 ([#879](https://github.com/databricks/databricks-sdk-go/pull/879)). * Bump golang.org/x/oauth2 from 0.18.0 to 0.20.0 ([#911](https://github.com/databricks/databricks-sdk-go/pull/911)). * Bump golang.org/x/net from 0.24.0 to 0.25.0 ([#912](https://github.com/databricks/databricks-sdk-go/pull/912)). * Bump google.golang.org/api from 0.169.0 to 0.182.0 ([#932](https://github.com/databricks/databricks-sdk-go/pull/932)). --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ version/version.go | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f89619286..18364a940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Version changelog +## 0.42.0 + +* Ignore additional flaky test ([#930](https://github.com/databricks/databricks-sdk-go/pull/930)). +* Ignore DataPlane Services during generation ([#933](https://github.com/databricks/databricks-sdk-go/pull/933)). +* Update OpenAPI spec ([#934](https://github.com/databricks/databricks-sdk-go/pull/934)). + +API Changes: + + * Changed `List` method for [a.AccountStorageCredentials](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AccountStorageCredentialsAPI) account-level service to return [catalog.ListAccountStorageCredentialsResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListAccountStorageCredentialsResponse). + * Added [catalog.ListAccountStorageCredentialsResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListAccountStorageCredentialsResponse). + * Added `TerminationCategory` field for [jobs.ForEachTaskErrorMessageStats](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#ForEachTaskErrorMessageStats). + * Added [oauth2.DataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#DataPlaneInfo). + * Removed `CreateDeployment` method for [w.Apps](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppsAPI) workspace-level service. + * Added `Deploy` method for [w.Apps](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppsAPI) workspace-level service. + * Added `Mode` field for [serving.AppDeployment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppDeployment). + * Added `Mode` field for [serving.CreateAppDeploymentRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#CreateAppDeploymentRequest). + * Added `DataPlaneInfo` field for [serving.ServingEndpointDetailed](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServingEndpointDetailed). + * Added [serving.AppDeploymentMode](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#AppDeploymentMode). + * Added [serving.ModelDataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ModelDataPlaneInfo). + +OpenAPI SHA: 37b925eba37dfb3d7e05b6ba2d458454ce62d3a0, Date: 2024-06-03 + +Dependency updates: + + * Bump golang.org/x/mod from 0.16.0 to 0.17.0 ([#879](https://github.com/databricks/databricks-sdk-go/pull/879)). + * Bump golang.org/x/oauth2 from 0.18.0 to 0.20.0 ([#911](https://github.com/databricks/databricks-sdk-go/pull/911)). + * Bump golang.org/x/net from 0.24.0 to 0.25.0 ([#912](https://github.com/databricks/databricks-sdk-go/pull/912)). + * Bump google.golang.org/api from 0.169.0 to 0.182.0 ([#932](https://github.com/databricks/databricks-sdk-go/pull/932)). + ## Release v0.41.0 ### Backward incompatible changes diff --git a/version/version.go b/version/version.go index 7280c7b92..b0a5ef53a 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // Version of the SDK, updated manually before every tag -const Version = "0.41.0" +const Version = "0.42.0" From 490bc13c0eede54ccbc35947472e0ead8ddb48f5 Mon Sep 17 00:00:00 2001 From: hectorcast-db Date: Fri, 7 Jun 2024 11:21:00 +0200 Subject: [PATCH 7/8] Generate from latest spec (#944) ## Changes Generate from latest spec ## Tests - [X] `make test` passing - [X] `make fmt` applied - [ ] relevant integration tests applied --- .codegen/_openapi_sha | 2 +- .../dashboards/mock_lakeview_interface.go | 1216 +++++++++++++++-- internal/catalog_test.go | 2 +- service/catalog/catalogs_usage_test.go | 2 +- service/catalog/model.go | 28 +- service/compute/model.go | 6 +- service/dashboards/api.go | 215 +++ service/dashboards/impl.go | 84 ++ service/dashboards/interface.go | 31 + service/dashboards/model.go | 335 +++++ service/iam/model.go | 6 +- service/jobs/model.go | 39 + service/pipelines/model.go | 2 +- service/serving/model.go | 4 + service/sql/model.go | 9 +- 15 files changed, 1819 insertions(+), 162 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index de0f45ab9..2efdf11e6 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -37b925eba37dfb3d7e05b6ba2d458454ce62d3a0 \ No newline at end of file +fc26589775a1c48b14211cd11b6903d1b4ed071c \ No newline at end of file diff --git a/experimental/mocks/service/dashboards/mock_lakeview_interface.go b/experimental/mocks/service/dashboards/mock_lakeview_interface.go index db05a87d9..48a91c8a8 100644 --- a/experimental/mocks/service/dashboards/mock_lakeview_interface.go +++ b/experimental/mocks/service/dashboards/mock_lakeview_interface.go @@ -5,104 +5,986 @@ package dashboards import ( context "context" + listing "github.com/databricks/databricks-sdk-go/listing" dashboards "github.com/databricks/databricks-sdk-go/service/dashboards" + mock "github.com/stretchr/testify/mock" ) -// MockLakeviewInterface is an autogenerated mock type for the LakeviewInterface type -type MockLakeviewInterface struct { - mock.Mock +// MockLakeviewInterface is an autogenerated mock type for the LakeviewInterface type +type MockLakeviewInterface struct { + mock.Mock +} + +type MockLakeviewInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockLakeviewInterface) EXPECT() *MockLakeviewInterface_Expecter { + return &MockLakeviewInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) Create(ctx context.Context, request dashboards.CreateDashboardRequest) (*dashboards.Dashboard, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *dashboards.Dashboard + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateDashboardRequest) (*dashboards.Dashboard, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateDashboardRequest) *dashboards.Dashboard); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Dashboard) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.CreateDashboardRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockLakeviewInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.CreateDashboardRequest +func (_e *MockLakeviewInterface_Expecter) Create(ctx interface{}, request interface{}) *MockLakeviewInterface_Create_Call { + return &MockLakeviewInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockLakeviewInterface_Create_Call) Run(run func(ctx context.Context, request dashboards.CreateDashboardRequest)) *MockLakeviewInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.CreateDashboardRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_Create_Call) Return(_a0 *dashboards.Dashboard, _a1 error) *MockLakeviewInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_Create_Call) RunAndReturn(run func(context.Context, dashboards.CreateDashboardRequest) (*dashboards.Dashboard, error)) *MockLakeviewInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// CreateSchedule provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) CreateSchedule(ctx context.Context, request dashboards.CreateScheduleRequest) (*dashboards.Schedule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateSchedule") + } + + var r0 *dashboards.Schedule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateScheduleRequest) (*dashboards.Schedule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateScheduleRequest) *dashboards.Schedule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Schedule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.CreateScheduleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_CreateSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSchedule' +type MockLakeviewInterface_CreateSchedule_Call struct { + *mock.Call +} + +// CreateSchedule is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.CreateScheduleRequest +func (_e *MockLakeviewInterface_Expecter) CreateSchedule(ctx interface{}, request interface{}) *MockLakeviewInterface_CreateSchedule_Call { + return &MockLakeviewInterface_CreateSchedule_Call{Call: _e.mock.On("CreateSchedule", ctx, request)} +} + +func (_c *MockLakeviewInterface_CreateSchedule_Call) Run(run func(ctx context.Context, request dashboards.CreateScheduleRequest)) *MockLakeviewInterface_CreateSchedule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.CreateScheduleRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_CreateSchedule_Call) Return(_a0 *dashboards.Schedule, _a1 error) *MockLakeviewInterface_CreateSchedule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_CreateSchedule_Call) RunAndReturn(run func(context.Context, dashboards.CreateScheduleRequest) (*dashboards.Schedule, error)) *MockLakeviewInterface_CreateSchedule_Call { + _c.Call.Return(run) + return _c +} + +// CreateSubscription provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) CreateSubscription(ctx context.Context, request dashboards.CreateSubscriptionRequest) (*dashboards.Subscription, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateSubscription") + } + + var r0 *dashboards.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateSubscriptionRequest) (*dashboards.Subscription, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateSubscriptionRequest) *dashboards.Subscription); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.CreateSubscriptionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_CreateSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSubscription' +type MockLakeviewInterface_CreateSubscription_Call struct { + *mock.Call +} + +// CreateSubscription is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.CreateSubscriptionRequest +func (_e *MockLakeviewInterface_Expecter) CreateSubscription(ctx interface{}, request interface{}) *MockLakeviewInterface_CreateSubscription_Call { + return &MockLakeviewInterface_CreateSubscription_Call{Call: _e.mock.On("CreateSubscription", ctx, request)} +} + +func (_c *MockLakeviewInterface_CreateSubscription_Call) Run(run func(ctx context.Context, request dashboards.CreateSubscriptionRequest)) *MockLakeviewInterface_CreateSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.CreateSubscriptionRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_CreateSubscription_Call) Return(_a0 *dashboards.Subscription, _a1 error) *MockLakeviewInterface_CreateSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_CreateSubscription_Call) RunAndReturn(run func(context.Context, dashboards.CreateSubscriptionRequest) (*dashboards.Subscription, error)) *MockLakeviewInterface_CreateSubscription_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSchedule provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) DeleteSchedule(ctx context.Context, request dashboards.DeleteScheduleRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteSchedule") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.DeleteScheduleRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewInterface_DeleteSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSchedule' +type MockLakeviewInterface_DeleteSchedule_Call struct { + *mock.Call +} + +// DeleteSchedule is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.DeleteScheduleRequest +func (_e *MockLakeviewInterface_Expecter) DeleteSchedule(ctx interface{}, request interface{}) *MockLakeviewInterface_DeleteSchedule_Call { + return &MockLakeviewInterface_DeleteSchedule_Call{Call: _e.mock.On("DeleteSchedule", ctx, request)} +} + +func (_c *MockLakeviewInterface_DeleteSchedule_Call) Run(run func(ctx context.Context, request dashboards.DeleteScheduleRequest)) *MockLakeviewInterface_DeleteSchedule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.DeleteScheduleRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_DeleteSchedule_Call) Return(_a0 error) *MockLakeviewInterface_DeleteSchedule_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewInterface_DeleteSchedule_Call) RunAndReturn(run func(context.Context, dashboards.DeleteScheduleRequest) error) *MockLakeviewInterface_DeleteSchedule_Call { + _c.Call.Return(run) + return _c +} + +// DeleteScheduleByDashboardIdAndScheduleId provides a mock function with given fields: ctx, dashboardId, scheduleId +func (_m *MockLakeviewInterface) DeleteScheduleByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) error { + ret := _m.Called(ctx, dashboardId, scheduleId) + + if len(ret) == 0 { + panic("no return value specified for DeleteScheduleByDashboardIdAndScheduleId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, dashboardId, scheduleId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteScheduleByDashboardIdAndScheduleId' +type MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call struct { + *mock.Call +} + +// DeleteScheduleByDashboardIdAndScheduleId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +// - scheduleId string +func (_e *MockLakeviewInterface_Expecter) DeleteScheduleByDashboardIdAndScheduleId(ctx interface{}, dashboardId interface{}, scheduleId interface{}) *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call { + return &MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call{Call: _e.mock.On("DeleteScheduleByDashboardIdAndScheduleId", ctx, dashboardId, scheduleId)} +} + +func (_c *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call) Run(run func(ctx context.Context, dashboardId string, scheduleId string)) *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call) Return(_a0 error) *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call) RunAndReturn(run func(context.Context, string, string) error) *MockLakeviewInterface_DeleteScheduleByDashboardIdAndScheduleId_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSubscription provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) DeleteSubscription(ctx context.Context, request dashboards.DeleteSubscriptionRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteSubscription") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.DeleteSubscriptionRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewInterface_DeleteSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSubscription' +type MockLakeviewInterface_DeleteSubscription_Call struct { + *mock.Call +} + +// DeleteSubscription is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.DeleteSubscriptionRequest +func (_e *MockLakeviewInterface_Expecter) DeleteSubscription(ctx interface{}, request interface{}) *MockLakeviewInterface_DeleteSubscription_Call { + return &MockLakeviewInterface_DeleteSubscription_Call{Call: _e.mock.On("DeleteSubscription", ctx, request)} +} + +func (_c *MockLakeviewInterface_DeleteSubscription_Call) Run(run func(ctx context.Context, request dashboards.DeleteSubscriptionRequest)) *MockLakeviewInterface_DeleteSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.DeleteSubscriptionRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_DeleteSubscription_Call) Return(_a0 error) *MockLakeviewInterface_DeleteSubscription_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewInterface_DeleteSubscription_Call) RunAndReturn(run func(context.Context, dashboards.DeleteSubscriptionRequest) error) *MockLakeviewInterface_DeleteSubscription_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId provides a mock function with given fields: ctx, dashboardId, scheduleId, subscriptionId +func (_m *MockLakeviewInterface) DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) error { + ret := _m.Called(ctx, dashboardId, scheduleId, subscriptionId) + + if len(ret) == 0 { + panic("no return value specified for DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, dashboardId, scheduleId, subscriptionId) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId' +type MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call struct { + *mock.Call +} + +// DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +// - scheduleId string +// - subscriptionId string +func (_e *MockLakeviewInterface_Expecter) DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx interface{}, dashboardId interface{}, scheduleId interface{}, subscriptionId interface{}) *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + return &MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call{Call: _e.mock.On("DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId", ctx, dashboardId, scheduleId, subscriptionId)} +} + +func (_c *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call) Run(run func(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string)) *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call) Return(_a0 error) *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockLakeviewInterface_DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) Get(ctx context.Context, request dashboards.GetDashboardRequest) (*dashboards.Dashboard, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *dashboards.Dashboard + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetDashboardRequest) (*dashboards.Dashboard, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetDashboardRequest) *dashboards.Dashboard); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Dashboard) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GetDashboardRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockLakeviewInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GetDashboardRequest +func (_e *MockLakeviewInterface_Expecter) Get(ctx interface{}, request interface{}) *MockLakeviewInterface_Get_Call { + return &MockLakeviewInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockLakeviewInterface_Get_Call) Run(run func(ctx context.Context, request dashboards.GetDashboardRequest)) *MockLakeviewInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GetDashboardRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_Get_Call) Return(_a0 *dashboards.Dashboard, _a1 error) *MockLakeviewInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_Get_Call) RunAndReturn(run func(context.Context, dashboards.GetDashboardRequest) (*dashboards.Dashboard, error)) *MockLakeviewInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByDashboardId provides a mock function with given fields: ctx, dashboardId +func (_m *MockLakeviewInterface) GetByDashboardId(ctx context.Context, dashboardId string) (*dashboards.Dashboard, error) { + ret := _m.Called(ctx, dashboardId) + + if len(ret) == 0 { + panic("no return value specified for GetByDashboardId") + } + + var r0 *dashboards.Dashboard + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*dashboards.Dashboard, error)); ok { + return rf(ctx, dashboardId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *dashboards.Dashboard); ok { + r0 = rf(ctx, dashboardId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Dashboard) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, dashboardId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByDashboardId' +type MockLakeviewInterface_GetByDashboardId_Call struct { + *mock.Call +} + +// GetByDashboardId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +func (_e *MockLakeviewInterface_Expecter) GetByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewInterface_GetByDashboardId_Call { + return &MockLakeviewInterface_GetByDashboardId_Call{Call: _e.mock.On("GetByDashboardId", ctx, dashboardId)} +} + +func (_c *MockLakeviewInterface_GetByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewInterface_GetByDashboardId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLakeviewInterface_GetByDashboardId_Call) Return(_a0 *dashboards.Dashboard, _a1 error) *MockLakeviewInterface_GetByDashboardId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetByDashboardId_Call) RunAndReturn(run func(context.Context, string) (*dashboards.Dashboard, error)) *MockLakeviewInterface_GetByDashboardId_Call { + _c.Call.Return(run) + return _c +} + +// GetPublished provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) GetPublished(ctx context.Context, request dashboards.GetPublishedDashboardRequest) (*dashboards.PublishedDashboard, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetPublished") + } + + var r0 *dashboards.PublishedDashboard + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetPublishedDashboardRequest) (*dashboards.PublishedDashboard, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetPublishedDashboardRequest) *dashboards.PublishedDashboard); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.PublishedDashboard) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GetPublishedDashboardRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetPublished_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublished' +type MockLakeviewInterface_GetPublished_Call struct { + *mock.Call +} + +// GetPublished is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GetPublishedDashboardRequest +func (_e *MockLakeviewInterface_Expecter) GetPublished(ctx interface{}, request interface{}) *MockLakeviewInterface_GetPublished_Call { + return &MockLakeviewInterface_GetPublished_Call{Call: _e.mock.On("GetPublished", ctx, request)} +} + +func (_c *MockLakeviewInterface_GetPublished_Call) Run(run func(ctx context.Context, request dashboards.GetPublishedDashboardRequest)) *MockLakeviewInterface_GetPublished_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GetPublishedDashboardRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_GetPublished_Call) Return(_a0 *dashboards.PublishedDashboard, _a1 error) *MockLakeviewInterface_GetPublished_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetPublished_Call) RunAndReturn(run func(context.Context, dashboards.GetPublishedDashboardRequest) (*dashboards.PublishedDashboard, error)) *MockLakeviewInterface_GetPublished_Call { + _c.Call.Return(run) + return _c +} + +// GetPublishedByDashboardId provides a mock function with given fields: ctx, dashboardId +func (_m *MockLakeviewInterface) GetPublishedByDashboardId(ctx context.Context, dashboardId string) (*dashboards.PublishedDashboard, error) { + ret := _m.Called(ctx, dashboardId) + + if len(ret) == 0 { + panic("no return value specified for GetPublishedByDashboardId") + } + + var r0 *dashboards.PublishedDashboard + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*dashboards.PublishedDashboard, error)); ok { + return rf(ctx, dashboardId) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *dashboards.PublishedDashboard); ok { + r0 = rf(ctx, dashboardId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.PublishedDashboard) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, dashboardId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetPublishedByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublishedByDashboardId' +type MockLakeviewInterface_GetPublishedByDashboardId_Call struct { + *mock.Call +} + +// GetPublishedByDashboardId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +func (_e *MockLakeviewInterface_Expecter) GetPublishedByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewInterface_GetPublishedByDashboardId_Call { + return &MockLakeviewInterface_GetPublishedByDashboardId_Call{Call: _e.mock.On("GetPublishedByDashboardId", ctx, dashboardId)} +} + +func (_c *MockLakeviewInterface_GetPublishedByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewInterface_GetPublishedByDashboardId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockLakeviewInterface_GetPublishedByDashboardId_Call) Return(_a0 *dashboards.PublishedDashboard, _a1 error) *MockLakeviewInterface_GetPublishedByDashboardId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetPublishedByDashboardId_Call) RunAndReturn(run func(context.Context, string) (*dashboards.PublishedDashboard, error)) *MockLakeviewInterface_GetPublishedByDashboardId_Call { + _c.Call.Return(run) + return _c +} + +// GetSchedule provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) GetSchedule(ctx context.Context, request dashboards.GetScheduleRequest) (*dashboards.Schedule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetSchedule") + } + + var r0 *dashboards.Schedule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetScheduleRequest) (*dashboards.Schedule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetScheduleRequest) *dashboards.Schedule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Schedule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GetScheduleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSchedule' +type MockLakeviewInterface_GetSchedule_Call struct { + *mock.Call +} + +// GetSchedule is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GetScheduleRequest +func (_e *MockLakeviewInterface_Expecter) GetSchedule(ctx interface{}, request interface{}) *MockLakeviewInterface_GetSchedule_Call { + return &MockLakeviewInterface_GetSchedule_Call{Call: _e.mock.On("GetSchedule", ctx, request)} +} + +func (_c *MockLakeviewInterface_GetSchedule_Call) Run(run func(ctx context.Context, request dashboards.GetScheduleRequest)) *MockLakeviewInterface_GetSchedule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GetScheduleRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_GetSchedule_Call) Return(_a0 *dashboards.Schedule, _a1 error) *MockLakeviewInterface_GetSchedule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetSchedule_Call) RunAndReturn(run func(context.Context, dashboards.GetScheduleRequest) (*dashboards.Schedule, error)) *MockLakeviewInterface_GetSchedule_Call { + _c.Call.Return(run) + return _c +} + +// GetScheduleByDashboardIdAndScheduleId provides a mock function with given fields: ctx, dashboardId, scheduleId +func (_m *MockLakeviewInterface) GetScheduleByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) (*dashboards.Schedule, error) { + ret := _m.Called(ctx, dashboardId, scheduleId) + + if len(ret) == 0 { + panic("no return value specified for GetScheduleByDashboardIdAndScheduleId") + } + + var r0 *dashboards.Schedule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*dashboards.Schedule, error)); ok { + return rf(ctx, dashboardId, scheduleId) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *dashboards.Schedule); ok { + r0 = rf(ctx, dashboardId, scheduleId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Schedule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, dashboardId, scheduleId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetScheduleByDashboardIdAndScheduleId' +type MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call struct { + *mock.Call +} + +// GetScheduleByDashboardIdAndScheduleId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +// - scheduleId string +func (_e *MockLakeviewInterface_Expecter) GetScheduleByDashboardIdAndScheduleId(ctx interface{}, dashboardId interface{}, scheduleId interface{}) *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call { + return &MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call{Call: _e.mock.On("GetScheduleByDashboardIdAndScheduleId", ctx, dashboardId, scheduleId)} +} + +func (_c *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call) Run(run func(ctx context.Context, dashboardId string, scheduleId string)) *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call) Return(_a0 *dashboards.Schedule, _a1 error) *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call) RunAndReturn(run func(context.Context, string, string) (*dashboards.Schedule, error)) *MockLakeviewInterface_GetScheduleByDashboardIdAndScheduleId_Call { + _c.Call.Return(run) + return _c +} + +// GetSubscription provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) GetSubscription(ctx context.Context, request dashboards.GetSubscriptionRequest) (*dashboards.Subscription, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetSubscription") + } + + var r0 *dashboards.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetSubscriptionRequest) (*dashboards.Subscription, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetSubscriptionRequest) *dashboards.Subscription); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.GetSubscriptionRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscription' +type MockLakeviewInterface_GetSubscription_Call struct { + *mock.Call +} + +// GetSubscription is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.GetSubscriptionRequest +func (_e *MockLakeviewInterface_Expecter) GetSubscription(ctx interface{}, request interface{}) *MockLakeviewInterface_GetSubscription_Call { + return &MockLakeviewInterface_GetSubscription_Call{Call: _e.mock.On("GetSubscription", ctx, request)} +} + +func (_c *MockLakeviewInterface_GetSubscription_Call) Run(run func(ctx context.Context, request dashboards.GetSubscriptionRequest)) *MockLakeviewInterface_GetSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.GetSubscriptionRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_GetSubscription_Call) Return(_a0 *dashboards.Subscription, _a1 error) *MockLakeviewInterface_GetSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetSubscription_Call) RunAndReturn(run func(context.Context, dashboards.GetSubscriptionRequest) (*dashboards.Subscription, error)) *MockLakeviewInterface_GetSubscription_Call { + _c.Call.Return(run) + return _c +} + +// GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId provides a mock function with given fields: ctx, dashboardId, scheduleId, subscriptionId +func (_m *MockLakeviewInterface) GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) (*dashboards.Subscription, error) { + ret := _m.Called(ctx, dashboardId, scheduleId, subscriptionId) + + if len(ret) == 0 { + panic("no return value specified for GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId") + } + + var r0 *dashboards.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*dashboards.Subscription, error)); ok { + return rf(ctx, dashboardId, scheduleId, subscriptionId) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *dashboards.Subscription); ok { + r0 = rf(ctx, dashboardId, scheduleId, subscriptionId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Subscription) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, dashboardId, scheduleId, subscriptionId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId' +type MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call struct { + *mock.Call } -type MockLakeviewInterface_Expecter struct { - mock *mock.Mock +// GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +// - scheduleId string +// - subscriptionId string +func (_e *MockLakeviewInterface_Expecter) GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx interface{}, dashboardId interface{}, scheduleId interface{}, subscriptionId interface{}) *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + return &MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call{Call: _e.mock.On("GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId", ctx, dashboardId, scheduleId, subscriptionId)} } -func (_m *MockLakeviewInterface) EXPECT() *MockLakeviewInterface_Expecter { - return &MockLakeviewInterface_Expecter{mock: &_m.Mock} +func (_c *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call) Run(run func(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string)) *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c } -// Create provides a mock function with given fields: ctx, request -func (_m *MockLakeviewInterface) Create(ctx context.Context, request dashboards.CreateDashboardRequest) (*dashboards.Dashboard, error) { - ret := _m.Called(ctx, request) +func (_c *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call) Return(_a0 *dashboards.Subscription, _a1 error) *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call) RunAndReturn(run func(context.Context, string, string, string) (*dashboards.Subscription, error)) *MockLakeviewInterface_GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockLakeviewInterface) Impl() dashboards.LakeviewService { + ret := _m.Called() if len(ret) == 0 { - panic("no return value specified for Create") + panic("no return value specified for Impl") } - var r0 *dashboards.Dashboard - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateDashboardRequest) (*dashboards.Dashboard, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, dashboards.CreateDashboardRequest) *dashboards.Dashboard); ok { - r0 = rf(ctx, request) + var r0 dashboards.LakeviewService + if rf, ok := ret.Get(0).(func() dashboards.LakeviewService); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*dashboards.Dashboard) + r0 = ret.Get(0).(dashboards.LakeviewService) } } - if rf, ok := ret.Get(1).(func(context.Context, dashboards.CreateDashboardRequest) error); ok { - r1 = rf(ctx, request) + return r0 +} + +// MockLakeviewInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockLakeviewInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockLakeviewInterface_Expecter) Impl() *MockLakeviewInterface_Impl_Call { + return &MockLakeviewInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockLakeviewInterface_Impl_Call) Run(run func()) *MockLakeviewInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockLakeviewInterface_Impl_Call) Return(_a0 dashboards.LakeviewService) *MockLakeviewInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockLakeviewInterface_Impl_Call) RunAndReturn(run func() dashboards.LakeviewService) *MockLakeviewInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// ListSchedules provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) ListSchedules(ctx context.Context, request dashboards.ListSchedulesRequest) listing.Iterator[dashboards.Schedule] { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for ListSchedules") + } + + var r0 listing.Iterator[dashboards.Schedule] + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListSchedulesRequest) listing.Iterator[dashboards.Schedule]); ok { + r0 = rf(ctx, request) } else { - r1 = ret.Error(1) + if ret.Get(0) != nil { + r0 = ret.Get(0).(listing.Iterator[dashboards.Schedule]) + } } - return r0, r1 + return r0 } -// MockLakeviewInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' -type MockLakeviewInterface_Create_Call struct { +// MockLakeviewInterface_ListSchedules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSchedules' +type MockLakeviewInterface_ListSchedules_Call struct { *mock.Call } -// Create is a helper method to define mock.On call +// ListSchedules is a helper method to define mock.On call // - ctx context.Context -// - request dashboards.CreateDashboardRequest -func (_e *MockLakeviewInterface_Expecter) Create(ctx interface{}, request interface{}) *MockLakeviewInterface_Create_Call { - return &MockLakeviewInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +// - request dashboards.ListSchedulesRequest +func (_e *MockLakeviewInterface_Expecter) ListSchedules(ctx interface{}, request interface{}) *MockLakeviewInterface_ListSchedules_Call { + return &MockLakeviewInterface_ListSchedules_Call{Call: _e.mock.On("ListSchedules", ctx, request)} } -func (_c *MockLakeviewInterface_Create_Call) Run(run func(ctx context.Context, request dashboards.CreateDashboardRequest)) *MockLakeviewInterface_Create_Call { +func (_c *MockLakeviewInterface_ListSchedules_Call) Run(run func(ctx context.Context, request dashboards.ListSchedulesRequest)) *MockLakeviewInterface_ListSchedules_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(dashboards.CreateDashboardRequest)) + run(args[0].(context.Context), args[1].(dashboards.ListSchedulesRequest)) }) return _c } -func (_c *MockLakeviewInterface_Create_Call) Return(_a0 *dashboards.Dashboard, _a1 error) *MockLakeviewInterface_Create_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockLakeviewInterface_ListSchedules_Call) Return(_a0 listing.Iterator[dashboards.Schedule]) *MockLakeviewInterface_ListSchedules_Call { + _c.Call.Return(_a0) return _c } -func (_c *MockLakeviewInterface_Create_Call) RunAndReturn(run func(context.Context, dashboards.CreateDashboardRequest) (*dashboards.Dashboard, error)) *MockLakeviewInterface_Create_Call { +func (_c *MockLakeviewInterface_ListSchedules_Call) RunAndReturn(run func(context.Context, dashboards.ListSchedulesRequest) listing.Iterator[dashboards.Schedule]) *MockLakeviewInterface_ListSchedules_Call { _c.Call.Return(run) return _c } -// Get provides a mock function with given fields: ctx, request -func (_m *MockLakeviewInterface) Get(ctx context.Context, request dashboards.GetDashboardRequest) (*dashboards.Dashboard, error) { +// ListSchedulesAll provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) ListSchedulesAll(ctx context.Context, request dashboards.ListSchedulesRequest) ([]dashboards.Schedule, error) { ret := _m.Called(ctx, request) if len(ret) == 0 { - panic("no return value specified for Get") + panic("no return value specified for ListSchedulesAll") } - var r0 *dashboards.Dashboard + var r0 []dashboards.Schedule var r1 error - if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetDashboardRequest) (*dashboards.Dashboard, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListSchedulesRequest) ([]dashboards.Schedule, error)); ok { return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetDashboardRequest) *dashboards.Dashboard); ok { + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListSchedulesRequest) []dashboards.Schedule); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*dashboards.Dashboard) + r0 = ret.Get(0).([]dashboards.Schedule) } } - if rf, ok := ret.Get(1).(func(context.Context, dashboards.GetDashboardRequest) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, dashboards.ListSchedulesRequest) error); ok { r1 = rf(ctx, request) } else { r1 = ret.Error(1) @@ -111,53 +993,53 @@ func (_m *MockLakeviewInterface) Get(ctx context.Context, request dashboards.Get return r0, r1 } -// MockLakeviewInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type MockLakeviewInterface_Get_Call struct { +// MockLakeviewInterface_ListSchedulesAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSchedulesAll' +type MockLakeviewInterface_ListSchedulesAll_Call struct { *mock.Call } -// Get is a helper method to define mock.On call +// ListSchedulesAll is a helper method to define mock.On call // - ctx context.Context -// - request dashboards.GetDashboardRequest -func (_e *MockLakeviewInterface_Expecter) Get(ctx interface{}, request interface{}) *MockLakeviewInterface_Get_Call { - return &MockLakeviewInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +// - request dashboards.ListSchedulesRequest +func (_e *MockLakeviewInterface_Expecter) ListSchedulesAll(ctx interface{}, request interface{}) *MockLakeviewInterface_ListSchedulesAll_Call { + return &MockLakeviewInterface_ListSchedulesAll_Call{Call: _e.mock.On("ListSchedulesAll", ctx, request)} } -func (_c *MockLakeviewInterface_Get_Call) Run(run func(ctx context.Context, request dashboards.GetDashboardRequest)) *MockLakeviewInterface_Get_Call { +func (_c *MockLakeviewInterface_ListSchedulesAll_Call) Run(run func(ctx context.Context, request dashboards.ListSchedulesRequest)) *MockLakeviewInterface_ListSchedulesAll_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(dashboards.GetDashboardRequest)) + run(args[0].(context.Context), args[1].(dashboards.ListSchedulesRequest)) }) return _c } -func (_c *MockLakeviewInterface_Get_Call) Return(_a0 *dashboards.Dashboard, _a1 error) *MockLakeviewInterface_Get_Call { +func (_c *MockLakeviewInterface_ListSchedulesAll_Call) Return(_a0 []dashboards.Schedule, _a1 error) *MockLakeviewInterface_ListSchedulesAll_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakeviewInterface_Get_Call) RunAndReturn(run func(context.Context, dashboards.GetDashboardRequest) (*dashboards.Dashboard, error)) *MockLakeviewInterface_Get_Call { +func (_c *MockLakeviewInterface_ListSchedulesAll_Call) RunAndReturn(run func(context.Context, dashboards.ListSchedulesRequest) ([]dashboards.Schedule, error)) *MockLakeviewInterface_ListSchedulesAll_Call { _c.Call.Return(run) return _c } -// GetByDashboardId provides a mock function with given fields: ctx, dashboardId -func (_m *MockLakeviewInterface) GetByDashboardId(ctx context.Context, dashboardId string) (*dashboards.Dashboard, error) { +// ListSchedulesByDashboardId provides a mock function with given fields: ctx, dashboardId +func (_m *MockLakeviewInterface) ListSchedulesByDashboardId(ctx context.Context, dashboardId string) (*dashboards.ListSchedulesResponse, error) { ret := _m.Called(ctx, dashboardId) if len(ret) == 0 { - panic("no return value specified for GetByDashboardId") + panic("no return value specified for ListSchedulesByDashboardId") } - var r0 *dashboards.Dashboard + var r0 *dashboards.ListSchedulesResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*dashboards.Dashboard, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) (*dashboards.ListSchedulesResponse, error)); ok { return rf(ctx, dashboardId) } - if rf, ok := ret.Get(0).(func(context.Context, string) *dashboards.Dashboard); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) *dashboards.ListSchedulesResponse); ok { r0 = rf(ctx, dashboardId) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*dashboards.Dashboard) + r0 = ret.Get(0).(*dashboards.ListSchedulesResponse) } } @@ -170,117 +1052,107 @@ func (_m *MockLakeviewInterface) GetByDashboardId(ctx context.Context, dashboard return r0, r1 } -// MockLakeviewInterface_GetByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByDashboardId' -type MockLakeviewInterface_GetByDashboardId_Call struct { +// MockLakeviewInterface_ListSchedulesByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSchedulesByDashboardId' +type MockLakeviewInterface_ListSchedulesByDashboardId_Call struct { *mock.Call } -// GetByDashboardId is a helper method to define mock.On call +// ListSchedulesByDashboardId is a helper method to define mock.On call // - ctx context.Context // - dashboardId string -func (_e *MockLakeviewInterface_Expecter) GetByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewInterface_GetByDashboardId_Call { - return &MockLakeviewInterface_GetByDashboardId_Call{Call: _e.mock.On("GetByDashboardId", ctx, dashboardId)} +func (_e *MockLakeviewInterface_Expecter) ListSchedulesByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewInterface_ListSchedulesByDashboardId_Call { + return &MockLakeviewInterface_ListSchedulesByDashboardId_Call{Call: _e.mock.On("ListSchedulesByDashboardId", ctx, dashboardId)} } -func (_c *MockLakeviewInterface_GetByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewInterface_GetByDashboardId_Call { +func (_c *MockLakeviewInterface_ListSchedulesByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewInterface_ListSchedulesByDashboardId_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string)) }) return _c } -func (_c *MockLakeviewInterface_GetByDashboardId_Call) Return(_a0 *dashboards.Dashboard, _a1 error) *MockLakeviewInterface_GetByDashboardId_Call { +func (_c *MockLakeviewInterface_ListSchedulesByDashboardId_Call) Return(_a0 *dashboards.ListSchedulesResponse, _a1 error) *MockLakeviewInterface_ListSchedulesByDashboardId_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakeviewInterface_GetByDashboardId_Call) RunAndReturn(run func(context.Context, string) (*dashboards.Dashboard, error)) *MockLakeviewInterface_GetByDashboardId_Call { +func (_c *MockLakeviewInterface_ListSchedulesByDashboardId_Call) RunAndReturn(run func(context.Context, string) (*dashboards.ListSchedulesResponse, error)) *MockLakeviewInterface_ListSchedulesByDashboardId_Call { _c.Call.Return(run) return _c } -// GetPublished provides a mock function with given fields: ctx, request -func (_m *MockLakeviewInterface) GetPublished(ctx context.Context, request dashboards.GetPublishedDashboardRequest) (*dashboards.PublishedDashboard, error) { +// ListSubscriptions provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) ListSubscriptions(ctx context.Context, request dashboards.ListSubscriptionsRequest) listing.Iterator[dashboards.Subscription] { ret := _m.Called(ctx, request) if len(ret) == 0 { - panic("no return value specified for GetPublished") + panic("no return value specified for ListSubscriptions") } - var r0 *dashboards.PublishedDashboard - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetPublishedDashboardRequest) (*dashboards.PublishedDashboard, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, dashboards.GetPublishedDashboardRequest) *dashboards.PublishedDashboard); ok { + var r0 listing.Iterator[dashboards.Subscription] + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListSubscriptionsRequest) listing.Iterator[dashboards.Subscription]); ok { r0 = rf(ctx, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*dashboards.PublishedDashboard) + r0 = ret.Get(0).(listing.Iterator[dashboards.Subscription]) } } - if rf, ok := ret.Get(1).(func(context.Context, dashboards.GetPublishedDashboardRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 + return r0 } -// MockLakeviewInterface_GetPublished_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublished' -type MockLakeviewInterface_GetPublished_Call struct { +// MockLakeviewInterface_ListSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubscriptions' +type MockLakeviewInterface_ListSubscriptions_Call struct { *mock.Call } -// GetPublished is a helper method to define mock.On call +// ListSubscriptions is a helper method to define mock.On call // - ctx context.Context -// - request dashboards.GetPublishedDashboardRequest -func (_e *MockLakeviewInterface_Expecter) GetPublished(ctx interface{}, request interface{}) *MockLakeviewInterface_GetPublished_Call { - return &MockLakeviewInterface_GetPublished_Call{Call: _e.mock.On("GetPublished", ctx, request)} +// - request dashboards.ListSubscriptionsRequest +func (_e *MockLakeviewInterface_Expecter) ListSubscriptions(ctx interface{}, request interface{}) *MockLakeviewInterface_ListSubscriptions_Call { + return &MockLakeviewInterface_ListSubscriptions_Call{Call: _e.mock.On("ListSubscriptions", ctx, request)} } -func (_c *MockLakeviewInterface_GetPublished_Call) Run(run func(ctx context.Context, request dashboards.GetPublishedDashboardRequest)) *MockLakeviewInterface_GetPublished_Call { +func (_c *MockLakeviewInterface_ListSubscriptions_Call) Run(run func(ctx context.Context, request dashboards.ListSubscriptionsRequest)) *MockLakeviewInterface_ListSubscriptions_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(dashboards.GetPublishedDashboardRequest)) + run(args[0].(context.Context), args[1].(dashboards.ListSubscriptionsRequest)) }) return _c } -func (_c *MockLakeviewInterface_GetPublished_Call) Return(_a0 *dashboards.PublishedDashboard, _a1 error) *MockLakeviewInterface_GetPublished_Call { - _c.Call.Return(_a0, _a1) +func (_c *MockLakeviewInterface_ListSubscriptions_Call) Return(_a0 listing.Iterator[dashboards.Subscription]) *MockLakeviewInterface_ListSubscriptions_Call { + _c.Call.Return(_a0) return _c } -func (_c *MockLakeviewInterface_GetPublished_Call) RunAndReturn(run func(context.Context, dashboards.GetPublishedDashboardRequest) (*dashboards.PublishedDashboard, error)) *MockLakeviewInterface_GetPublished_Call { +func (_c *MockLakeviewInterface_ListSubscriptions_Call) RunAndReturn(run func(context.Context, dashboards.ListSubscriptionsRequest) listing.Iterator[dashboards.Subscription]) *MockLakeviewInterface_ListSubscriptions_Call { _c.Call.Return(run) return _c } -// GetPublishedByDashboardId provides a mock function with given fields: ctx, dashboardId -func (_m *MockLakeviewInterface) GetPublishedByDashboardId(ctx context.Context, dashboardId string) (*dashboards.PublishedDashboard, error) { - ret := _m.Called(ctx, dashboardId) +// ListSubscriptionsAll provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) ListSubscriptionsAll(ctx context.Context, request dashboards.ListSubscriptionsRequest) ([]dashboards.Subscription, error) { + ret := _m.Called(ctx, request) if len(ret) == 0 { - panic("no return value specified for GetPublishedByDashboardId") + panic("no return value specified for ListSubscriptionsAll") } - var r0 *dashboards.PublishedDashboard + var r0 []dashboards.Subscription var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*dashboards.PublishedDashboard, error)); ok { - return rf(ctx, dashboardId) + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListSubscriptionsRequest) ([]dashboards.Subscription, error)); ok { + return rf(ctx, request) } - if rf, ok := ret.Get(0).(func(context.Context, string) *dashboards.PublishedDashboard); ok { - r0 = rf(ctx, dashboardId) + if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListSubscriptionsRequest) []dashboards.Subscription); ok { + r0 = rf(ctx, request) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*dashboards.PublishedDashboard) + r0 = ret.Get(0).([]dashboards.Subscription) } } - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, dashboardId) + if rf, ok := ret.Get(1).(func(context.Context, dashboards.ListSubscriptionsRequest) error); ok { + r1 = rf(ctx, request) } else { r1 = ret.Error(1) } @@ -288,78 +1160,91 @@ func (_m *MockLakeviewInterface) GetPublishedByDashboardId(ctx context.Context, return r0, r1 } -// MockLakeviewInterface_GetPublishedByDashboardId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublishedByDashboardId' -type MockLakeviewInterface_GetPublishedByDashboardId_Call struct { +// MockLakeviewInterface_ListSubscriptionsAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubscriptionsAll' +type MockLakeviewInterface_ListSubscriptionsAll_Call struct { *mock.Call } -// GetPublishedByDashboardId is a helper method to define mock.On call +// ListSubscriptionsAll is a helper method to define mock.On call // - ctx context.Context -// - dashboardId string -func (_e *MockLakeviewInterface_Expecter) GetPublishedByDashboardId(ctx interface{}, dashboardId interface{}) *MockLakeviewInterface_GetPublishedByDashboardId_Call { - return &MockLakeviewInterface_GetPublishedByDashboardId_Call{Call: _e.mock.On("GetPublishedByDashboardId", ctx, dashboardId)} +// - request dashboards.ListSubscriptionsRequest +func (_e *MockLakeviewInterface_Expecter) ListSubscriptionsAll(ctx interface{}, request interface{}) *MockLakeviewInterface_ListSubscriptionsAll_Call { + return &MockLakeviewInterface_ListSubscriptionsAll_Call{Call: _e.mock.On("ListSubscriptionsAll", ctx, request)} } -func (_c *MockLakeviewInterface_GetPublishedByDashboardId_Call) Run(run func(ctx context.Context, dashboardId string)) *MockLakeviewInterface_GetPublishedByDashboardId_Call { +func (_c *MockLakeviewInterface_ListSubscriptionsAll_Call) Run(run func(ctx context.Context, request dashboards.ListSubscriptionsRequest)) *MockLakeviewInterface_ListSubscriptionsAll_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + run(args[0].(context.Context), args[1].(dashboards.ListSubscriptionsRequest)) }) return _c } -func (_c *MockLakeviewInterface_GetPublishedByDashboardId_Call) Return(_a0 *dashboards.PublishedDashboard, _a1 error) *MockLakeviewInterface_GetPublishedByDashboardId_Call { +func (_c *MockLakeviewInterface_ListSubscriptionsAll_Call) Return(_a0 []dashboards.Subscription, _a1 error) *MockLakeviewInterface_ListSubscriptionsAll_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakeviewInterface_GetPublishedByDashboardId_Call) RunAndReturn(run func(context.Context, string) (*dashboards.PublishedDashboard, error)) *MockLakeviewInterface_GetPublishedByDashboardId_Call { +func (_c *MockLakeviewInterface_ListSubscriptionsAll_Call) RunAndReturn(run func(context.Context, dashboards.ListSubscriptionsRequest) ([]dashboards.Subscription, error)) *MockLakeviewInterface_ListSubscriptionsAll_Call { _c.Call.Return(run) return _c } -// Impl provides a mock function with given fields: -func (_m *MockLakeviewInterface) Impl() dashboards.LakeviewService { - ret := _m.Called() +// ListSubscriptionsByDashboardIdAndScheduleId provides a mock function with given fields: ctx, dashboardId, scheduleId +func (_m *MockLakeviewInterface) ListSubscriptionsByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) (*dashboards.ListSubscriptionsResponse, error) { + ret := _m.Called(ctx, dashboardId, scheduleId) if len(ret) == 0 { - panic("no return value specified for Impl") + panic("no return value specified for ListSubscriptionsByDashboardIdAndScheduleId") } - var r0 dashboards.LakeviewService - if rf, ok := ret.Get(0).(func() dashboards.LakeviewService); ok { - r0 = rf() + var r0 *dashboards.ListSubscriptionsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*dashboards.ListSubscriptionsResponse, error)); ok { + return rf(ctx, dashboardId, scheduleId) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *dashboards.ListSubscriptionsResponse); ok { + r0 = rf(ctx, dashboardId, scheduleId) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(dashboards.LakeviewService) + r0 = ret.Get(0).(*dashboards.ListSubscriptionsResponse) } } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, dashboardId, scheduleId) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } -// MockLakeviewInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' -type MockLakeviewInterface_Impl_Call struct { +// MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubscriptionsByDashboardIdAndScheduleId' +type MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call struct { *mock.Call } -// Impl is a helper method to define mock.On call -func (_e *MockLakeviewInterface_Expecter) Impl() *MockLakeviewInterface_Impl_Call { - return &MockLakeviewInterface_Impl_Call{Call: _e.mock.On("Impl")} +// ListSubscriptionsByDashboardIdAndScheduleId is a helper method to define mock.On call +// - ctx context.Context +// - dashboardId string +// - scheduleId string +func (_e *MockLakeviewInterface_Expecter) ListSubscriptionsByDashboardIdAndScheduleId(ctx interface{}, dashboardId interface{}, scheduleId interface{}) *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call { + return &MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call{Call: _e.mock.On("ListSubscriptionsByDashboardIdAndScheduleId", ctx, dashboardId, scheduleId)} } -func (_c *MockLakeviewInterface_Impl_Call) Run(run func()) *MockLakeviewInterface_Impl_Call { +func (_c *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call) Run(run func(ctx context.Context, dashboardId string, scheduleId string)) *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call { _c.Call.Run(func(args mock.Arguments) { - run() + run(args[0].(context.Context), args[1].(string), args[2].(string)) }) return _c } -func (_c *MockLakeviewInterface_Impl_Call) Return(_a0 dashboards.LakeviewService) *MockLakeviewInterface_Impl_Call { - _c.Call.Return(_a0) +func (_c *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call) Return(_a0 *dashboards.ListSubscriptionsResponse, _a1 error) *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MockLakeviewInterface_Impl_Call) RunAndReturn(run func() dashboards.LakeviewService) *MockLakeviewInterface_Impl_Call { +func (_c *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call) RunAndReturn(run func(context.Context, string, string) (*dashboards.ListSubscriptionsResponse, error)) *MockLakeviewInterface_ListSubscriptionsByDashboardIdAndScheduleId_Call { _c.Call.Return(run) return _c } @@ -729,6 +1614,65 @@ func (_c *MockLakeviewInterface_Update_Call) RunAndReturn(run func(context.Conte return _c } +// UpdateSchedule provides a mock function with given fields: ctx, request +func (_m *MockLakeviewInterface) UpdateSchedule(ctx context.Context, request dashboards.UpdateScheduleRequest) (*dashboards.Schedule, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for UpdateSchedule") + } + + var r0 *dashboards.Schedule + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, dashboards.UpdateScheduleRequest) (*dashboards.Schedule, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, dashboards.UpdateScheduleRequest) *dashboards.Schedule); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*dashboards.Schedule) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, dashboards.UpdateScheduleRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockLakeviewInterface_UpdateSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSchedule' +type MockLakeviewInterface_UpdateSchedule_Call struct { + *mock.Call +} + +// UpdateSchedule is a helper method to define mock.On call +// - ctx context.Context +// - request dashboards.UpdateScheduleRequest +func (_e *MockLakeviewInterface_Expecter) UpdateSchedule(ctx interface{}, request interface{}) *MockLakeviewInterface_UpdateSchedule_Call { + return &MockLakeviewInterface_UpdateSchedule_Call{Call: _e.mock.On("UpdateSchedule", ctx, request)} +} + +func (_c *MockLakeviewInterface_UpdateSchedule_Call) Run(run func(ctx context.Context, request dashboards.UpdateScheduleRequest)) *MockLakeviewInterface_UpdateSchedule_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(dashboards.UpdateScheduleRequest)) + }) + return _c +} + +func (_c *MockLakeviewInterface_UpdateSchedule_Call) Return(_a0 *dashboards.Schedule, _a1 error) *MockLakeviewInterface_UpdateSchedule_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockLakeviewInterface_UpdateSchedule_Call) RunAndReturn(run func(context.Context, dashboards.UpdateScheduleRequest) (*dashboards.Schedule, error)) *MockLakeviewInterface_UpdateSchedule_Call { + _c.Call.Return(run) + return _c +} + // WithImpl provides a mock function with given fields: impl func (_m *MockLakeviewInterface) WithImpl(impl dashboards.LakeviewService) dashboards.LakeviewInterface { ret := _m.Called(impl) diff --git a/internal/catalog_test.go b/internal/catalog_test.go index a8aa09c09..7b7e9a9ee 100644 --- a/internal/catalog_test.go +++ b/internal/catalog_test.go @@ -364,7 +364,7 @@ func TestUcAccCatalogWorkspaceBindings(t *testing.T) { _, err = w.Catalogs.Update(ctx, catalog.UpdateCatalog{ Name: created.Name, - IsolationMode: catalog.IsolationModeIsolated, + IsolationMode: catalog.IsolationModeIsolationModeIsolated, }) require.NoError(t, err) diff --git a/service/catalog/catalogs_usage_test.go b/service/catalog/catalogs_usage_test.go index d1725a701..e2d1a696c 100755 --- a/service/catalog/catalogs_usage_test.go +++ b/service/catalog/catalogs_usage_test.go @@ -274,7 +274,7 @@ func ExampleCatalogsAPI_Update_catalogWorkspaceBindings() { _, err = w.Catalogs.Update(ctx, catalog.UpdateCatalog{ Name: created.Name, - IsolationMode: catalog.IsolationModeIsolated, + IsolationMode: catalog.IsolationModeIsolationModeIsolated, }) if err != nil { panic(err) diff --git a/service/catalog/model.go b/service/catalog/model.go index 8a25042f3..efb4f7268 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -311,10 +311,6 @@ const CatalogInfoSecurableKindCatalogForeignSqlserver CatalogInfoSecurableKind = const CatalogInfoSecurableKindCatalogInternal CatalogInfoSecurableKind = `CATALOG_INTERNAL` -const CatalogInfoSecurableKindCatalogOnline CatalogInfoSecurableKind = `CATALOG_ONLINE` - -const CatalogInfoSecurableKindCatalogOnlineIndex CatalogInfoSecurableKind = `CATALOG_ONLINE_INDEX` - const CatalogInfoSecurableKindCatalogStandard CatalogInfoSecurableKind = `CATALOG_STANDARD` const CatalogInfoSecurableKindCatalogSystem CatalogInfoSecurableKind = `CATALOG_SYSTEM` @@ -329,11 +325,11 @@ func (f *CatalogInfoSecurableKind) String() string { // Set raw string value and validate it against allowed values func (f *CatalogInfoSecurableKind) Set(v string) error { switch v { - case `CATALOG_DELTASHARING`, `CATALOG_FOREIGN_BIGQUERY`, `CATALOG_FOREIGN_DATABRICKS`, `CATALOG_FOREIGN_MYSQL`, `CATALOG_FOREIGN_POSTGRESQL`, `CATALOG_FOREIGN_REDSHIFT`, `CATALOG_FOREIGN_SNOWFLAKE`, `CATALOG_FOREIGN_SQLDW`, `CATALOG_FOREIGN_SQLSERVER`, `CATALOG_INTERNAL`, `CATALOG_ONLINE`, `CATALOG_ONLINE_INDEX`, `CATALOG_STANDARD`, `CATALOG_SYSTEM`, `CATALOG_SYSTEM_DELTASHARING`: + case `CATALOG_DELTASHARING`, `CATALOG_FOREIGN_BIGQUERY`, `CATALOG_FOREIGN_DATABRICKS`, `CATALOG_FOREIGN_MYSQL`, `CATALOG_FOREIGN_POSTGRESQL`, `CATALOG_FOREIGN_REDSHIFT`, `CATALOG_FOREIGN_SNOWFLAKE`, `CATALOG_FOREIGN_SQLDW`, `CATALOG_FOREIGN_SQLSERVER`, `CATALOG_INTERNAL`, `CATALOG_STANDARD`, `CATALOG_SYSTEM`, `CATALOG_SYSTEM_DELTASHARING`: *f = CatalogInfoSecurableKind(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "CATALOG_DELTASHARING", "CATALOG_FOREIGN_BIGQUERY", "CATALOG_FOREIGN_DATABRICKS", "CATALOG_FOREIGN_MYSQL", "CATALOG_FOREIGN_POSTGRESQL", "CATALOG_FOREIGN_REDSHIFT", "CATALOG_FOREIGN_SNOWFLAKE", "CATALOG_FOREIGN_SQLDW", "CATALOG_FOREIGN_SQLSERVER", "CATALOG_INTERNAL", "CATALOG_ONLINE", "CATALOG_ONLINE_INDEX", "CATALOG_STANDARD", "CATALOG_SYSTEM", "CATALOG_SYSTEM_DELTASHARING"`, v) + return fmt.Errorf(`value "%s" is not one of "CATALOG_DELTASHARING", "CATALOG_FOREIGN_BIGQUERY", "CATALOG_FOREIGN_DATABRICKS", "CATALOG_FOREIGN_MYSQL", "CATALOG_FOREIGN_POSTGRESQL", "CATALOG_FOREIGN_REDSHIFT", "CATALOG_FOREIGN_SNOWFLAKE", "CATALOG_FOREIGN_SQLDW", "CATALOG_FOREIGN_SQLSERVER", "CATALOG_INTERNAL", "CATALOG_STANDARD", "CATALOG_SYSTEM", "CATALOG_SYSTEM_DELTASHARING"`, v) } } @@ -1087,7 +1083,7 @@ type CreateStorageCredential struct { CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` // Comment associated with the credential. Comment string `json:"comment,omitempty"` - // The managed GCP service account configuration. + // The Databricks managed GCP service account configuration. DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` // The credential name. The name must be unique within the metastore. Name string `json:"name"` @@ -1685,6 +1681,9 @@ type ExternalLocationInfo struct { CredentialName string `json:"credential_name,omitempty"` // Encryption options that apply to clients connecting to cloud storage. EncryptionDetails *EncryptionDetails `json:"encryption_details,omitempty"` + // Whether the current securable is accessible from all workspaces or a + // specific set of workspaces. + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` // Unique identifier of metastore hosting the external location. MetastoreId string `json:"metastore_id,omitempty"` // Name of the external location. @@ -2394,9 +2393,9 @@ type GetWorkspaceBindingRequest struct { // set of workspaces. type IsolationMode string -const IsolationModeIsolated IsolationMode = `ISOLATED` +const IsolationModeIsolationModeIsolated IsolationMode = `ISOLATION_MODE_ISOLATED` -const IsolationModeOpen IsolationMode = `OPEN` +const IsolationModeIsolationModeOpen IsolationMode = `ISOLATION_MODE_OPEN` // String representation for [fmt.Print] func (f *IsolationMode) String() string { @@ -2406,11 +2405,11 @@ func (f *IsolationMode) String() string { // Set raw string value and validate it against allowed values func (f *IsolationMode) Set(v string) error { switch v { - case `ISOLATED`, `OPEN`: + case `ISOLATION_MODE_ISOLATED`, `ISOLATION_MODE_OPEN`: *f = IsolationMode(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "ISOLATED", "OPEN"`, v) + return fmt.Errorf(`value "%s" is not one of "ISOLATION_MODE_ISOLATED", "ISOLATION_MODE_OPEN"`, v) } } @@ -4270,10 +4269,13 @@ type StorageCredentialInfo struct { CreatedAt int64 `json:"created_at,omitempty"` // Username of credential creator. CreatedBy string `json:"created_by,omitempty"` - // The managed GCP service account configuration. + // The Databricks managed GCP service account configuration. DatabricksGcpServiceAccount *DatabricksGcpServiceAccountResponse `json:"databricks_gcp_service_account,omitempty"` // The unique identifier of the credential. Id string `json:"id,omitempty"` + // Whether the current securable is accessible from all workspaces or a + // specific set of workspaces. + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` // Unique identifier of parent metastore. MetastoreId string `json:"metastore_id,omitempty"` // The credential name. The name must be unique within the metastore. @@ -4898,7 +4900,7 @@ type UpdateStorageCredential struct { CloudflareApiToken *CloudflareApiToken `json:"cloudflare_api_token,omitempty"` // Comment associated with the credential. Comment string `json:"comment,omitempty"` - // The managed GCP service account configuration. + // The Databricks managed GCP service account configuration. DatabricksGcpServiceAccount *DatabricksGcpServiceAccountRequest `json:"databricks_gcp_service_account,omitempty"` // Force update even if there are dependent external locations or external // tables. diff --git a/service/compute/model.go b/service/compute/model.go index 354002147..3f4fba20a 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -633,8 +633,8 @@ type ClusterDetails struct { DockerImage *DockerImage `json:"docker_image,omitempty"` // Node on which the Spark driver resides. The driver node contains the - // Spark master and the application that manages the - // per-notebook Spark REPLs. + // Spark master and the Databricks application that manages the per-notebook + // Spark REPLs. Driver *SparkNode `json:"driver,omitempty"` // The optional ID of the instance pool for the driver of the cluster // belongs. The pool cluster uses the instance pool with id @@ -4101,7 +4101,7 @@ type Policy struct { Definition string `json:"definition,omitempty"` // Additional human-readable description of the cluster policy. Description string `json:"description,omitempty"` - // If true, policy is a default policy created and managed by . + // If true, policy is a default policy created and managed by Databricks. // Default policies cannot be deleted, and their policy families cannot be // changed. IsDefault bool `json:"is_default,omitempty"` diff --git a/service/dashboards/api.go b/service/dashboards/api.go index 57273bab2..3e23829a1 100755 --- a/service/dashboards/api.go +++ b/service/dashboards/api.go @@ -7,6 +7,8 @@ import ( "context" "github.com/databricks/databricks-sdk-go/client" + "github.com/databricks/databricks-sdk-go/listing" + "github.com/databricks/databricks-sdk-go/useragent" ) type LakeviewInterface interface { @@ -24,6 +26,24 @@ type LakeviewInterface interface { // Create a draft dashboard. Create(ctx context.Context, request CreateDashboardRequest) (*Dashboard, error) + // Create dashboard schedule. + CreateSchedule(ctx context.Context, request CreateScheduleRequest) (*Schedule, error) + + // Create schedule subscription. + CreateSubscription(ctx context.Context, request CreateSubscriptionRequest) (*Subscription, error) + + // Delete dashboard schedule. + DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) error + + // Delete dashboard schedule. + DeleteScheduleByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) error + + // Delete schedule subscription. + DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) error + + // Delete schedule subscription. + DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) error + // Get dashboard. // // Get a draft dashboard. @@ -44,6 +64,44 @@ type LakeviewInterface interface { // Get the current published dashboard. GetPublishedByDashboardId(ctx context.Context, dashboardId string) (*PublishedDashboard, error) + // Get dashboard schedule. + GetSchedule(ctx context.Context, request GetScheduleRequest) (*Schedule, error) + + // Get dashboard schedule. + GetScheduleByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) (*Schedule, error) + + // Get schedule subscription. + GetSubscription(ctx context.Context, request GetSubscriptionRequest) (*Subscription, error) + + // Get schedule subscription. + GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) (*Subscription, error) + + // List dashboard schedules. + // + // This method is generated by Databricks SDK Code Generator. + ListSchedules(ctx context.Context, request ListSchedulesRequest) listing.Iterator[Schedule] + + // List dashboard schedules. + // + // This method is generated by Databricks SDK Code Generator. + ListSchedulesAll(ctx context.Context, request ListSchedulesRequest) ([]Schedule, error) + + // List dashboard schedules. + ListSchedulesByDashboardId(ctx context.Context, dashboardId string) (*ListSchedulesResponse, error) + + // List schedule subscriptions. + // + // This method is generated by Databricks SDK Code Generator. + ListSubscriptions(ctx context.Context, request ListSubscriptionsRequest) listing.Iterator[Subscription] + + // List schedule subscriptions. + // + // This method is generated by Databricks SDK Code Generator. + ListSubscriptionsAll(ctx context.Context, request ListSubscriptionsRequest) ([]Subscription, error) + + // List schedule subscriptions. + ListSubscriptionsByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) (*ListSubscriptionsResponse, error) + // Migrate dashboard. // // Migrates a classic SQL dashboard to Lakeview. @@ -78,6 +136,9 @@ type LakeviewInterface interface { // // Update a draft dashboard. Update(ctx context.Context, request UpdateDashboardRequest) (*Dashboard, error) + + // Update dashboard schedule. + UpdateSchedule(ctx context.Context, request UpdateScheduleRequest) (*Schedule, error) } func NewLakeview(client *client.DatabricksClient) *LakeviewAPI { @@ -118,6 +179,43 @@ func (a *LakeviewAPI) Create(ctx context.Context, request CreateDashboardRequest return a.impl.Create(ctx, request) } +// Create dashboard schedule. +func (a *LakeviewAPI) CreateSchedule(ctx context.Context, request CreateScheduleRequest) (*Schedule, error) { + return a.impl.CreateSchedule(ctx, request) +} + +// Create schedule subscription. +func (a *LakeviewAPI) CreateSubscription(ctx context.Context, request CreateSubscriptionRequest) (*Subscription, error) { + return a.impl.CreateSubscription(ctx, request) +} + +// Delete dashboard schedule. +func (a *LakeviewAPI) DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) error { + return a.impl.DeleteSchedule(ctx, request) +} + +// Delete dashboard schedule. +func (a *LakeviewAPI) DeleteScheduleByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) error { + return a.impl.DeleteSchedule(ctx, DeleteScheduleRequest{ + DashboardId: dashboardId, + ScheduleId: scheduleId, + }) +} + +// Delete schedule subscription. +func (a *LakeviewAPI) DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) error { + return a.impl.DeleteSubscription(ctx, request) +} + +// Delete schedule subscription. +func (a *LakeviewAPI) DeleteSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) error { + return a.impl.DeleteSubscription(ctx, DeleteSubscriptionRequest{ + DashboardId: dashboardId, + ScheduleId: scheduleId, + SubscriptionId: subscriptionId, + }) +} + // Get dashboard. // // Get a draft dashboard. @@ -150,6 +248,118 @@ func (a *LakeviewAPI) GetPublishedByDashboardId(ctx context.Context, dashboardId }) } +// Get dashboard schedule. +func (a *LakeviewAPI) GetSchedule(ctx context.Context, request GetScheduleRequest) (*Schedule, error) { + return a.impl.GetSchedule(ctx, request) +} + +// Get dashboard schedule. +func (a *LakeviewAPI) GetScheduleByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) (*Schedule, error) { + return a.impl.GetSchedule(ctx, GetScheduleRequest{ + DashboardId: dashboardId, + ScheduleId: scheduleId, + }) +} + +// Get schedule subscription. +func (a *LakeviewAPI) GetSubscription(ctx context.Context, request GetSubscriptionRequest) (*Subscription, error) { + return a.impl.GetSubscription(ctx, request) +} + +// Get schedule subscription. +func (a *LakeviewAPI) GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) (*Subscription, error) { + return a.impl.GetSubscription(ctx, GetSubscriptionRequest{ + DashboardId: dashboardId, + ScheduleId: scheduleId, + SubscriptionId: subscriptionId, + }) +} + +// List dashboard schedules. +// +// This method is generated by Databricks SDK Code Generator. +func (a *LakeviewAPI) ListSchedules(ctx context.Context, request ListSchedulesRequest) listing.Iterator[Schedule] { + + getNextPage := func(ctx context.Context, req ListSchedulesRequest) (*ListSchedulesResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.ListSchedules(ctx, req) + } + getItems := func(resp *ListSchedulesResponse) []Schedule { + return resp.Schedules + } + getNextReq := func(resp *ListSchedulesResponse) *ListSchedulesRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List dashboard schedules. +// +// This method is generated by Databricks SDK Code Generator. +func (a *LakeviewAPI) ListSchedulesAll(ctx context.Context, request ListSchedulesRequest) ([]Schedule, error) { + iterator := a.ListSchedules(ctx, request) + return listing.ToSlice[Schedule](ctx, iterator) +} + +// List dashboard schedules. +func (a *LakeviewAPI) ListSchedulesByDashboardId(ctx context.Context, dashboardId string) (*ListSchedulesResponse, error) { + return a.impl.ListSchedules(ctx, ListSchedulesRequest{ + DashboardId: dashboardId, + }) +} + +// List schedule subscriptions. +// +// This method is generated by Databricks SDK Code Generator. +func (a *LakeviewAPI) ListSubscriptions(ctx context.Context, request ListSubscriptionsRequest) listing.Iterator[Subscription] { + + getNextPage := func(ctx context.Context, req ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) { + ctx = useragent.InContext(ctx, "sdk-feature", "pagination") + return a.impl.ListSubscriptions(ctx, req) + } + getItems := func(resp *ListSubscriptionsResponse) []Subscription { + return resp.Subscriptions + } + getNextReq := func(resp *ListSubscriptionsResponse) *ListSubscriptionsRequest { + if resp.NextPageToken == "" { + return nil + } + request.PageToken = resp.NextPageToken + return &request + } + iterator := listing.NewIterator( + &request, + getNextPage, + getItems, + getNextReq) + return iterator +} + +// List schedule subscriptions. +// +// This method is generated by Databricks SDK Code Generator. +func (a *LakeviewAPI) ListSubscriptionsAll(ctx context.Context, request ListSubscriptionsRequest) ([]Subscription, error) { + iterator := a.ListSubscriptions(ctx, request) + return listing.ToSlice[Subscription](ctx, iterator) +} + +// List schedule subscriptions. +func (a *LakeviewAPI) ListSubscriptionsByDashboardIdAndScheduleId(ctx context.Context, dashboardId string, scheduleId string) (*ListSubscriptionsResponse, error) { + return a.impl.ListSubscriptions(ctx, ListSubscriptionsRequest{ + DashboardId: dashboardId, + ScheduleId: scheduleId, + }) +} + // Migrate dashboard. // // Migrates a classic SQL dashboard to Lakeview. @@ -202,3 +412,8 @@ func (a *LakeviewAPI) UnpublishByDashboardId(ctx context.Context, dashboardId st func (a *LakeviewAPI) Update(ctx context.Context, request UpdateDashboardRequest) (*Dashboard, error) { return a.impl.Update(ctx, request) } + +// Update dashboard schedule. +func (a *LakeviewAPI) UpdateSchedule(ctx context.Context, request UpdateScheduleRequest) (*Schedule, error) { + return a.impl.UpdateSchedule(ctx, request) +} diff --git a/service/dashboards/impl.go b/service/dashboards/impl.go index dc716589b..ea15b310d 100755 --- a/service/dashboards/impl.go +++ b/service/dashboards/impl.go @@ -25,6 +25,44 @@ func (a *lakeviewImpl) Create(ctx context.Context, request CreateDashboardReques return &dashboard, err } +func (a *lakeviewImpl) CreateSchedule(ctx context.Context, request CreateScheduleRequest) (*Schedule, error) { + var schedule Schedule + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", request.DashboardId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &schedule) + return &schedule, err +} + +func (a *lakeviewImpl) CreateSubscription(ctx context.Context, request CreateSubscriptionRequest) (*Subscription, error) { + var subscription Subscription + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions", request.DashboardId, request.ScheduleId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &subscription) + return &subscription, err +} + +func (a *lakeviewImpl) DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) error { + var deleteScheduleResponse DeleteScheduleResponse + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteScheduleResponse) + return err +} + +func (a *lakeviewImpl) DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) error { + var deleteSubscriptionResponse DeleteSubscriptionResponse + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", request.DashboardId, request.ScheduleId, request.SubscriptionId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteSubscriptionResponse) + return err +} + func (a *lakeviewImpl) Get(ctx context.Context, request GetDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v", request.DashboardId) @@ -43,6 +81,42 @@ func (a *lakeviewImpl) GetPublished(ctx context.Context, request GetPublishedDas return &publishedDashboard, err } +func (a *lakeviewImpl) GetSchedule(ctx context.Context, request GetScheduleRequest) (*Schedule, error) { + var schedule Schedule + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &schedule) + return &schedule, err +} + +func (a *lakeviewImpl) GetSubscription(ctx context.Context, request GetSubscriptionRequest) (*Subscription, error) { + var subscription Subscription + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions/%v", request.DashboardId, request.ScheduleId, request.SubscriptionId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &subscription) + return &subscription, err +} + +func (a *lakeviewImpl) ListSchedules(ctx context.Context, request ListSchedulesRequest) (*ListSchedulesResponse, error) { + var listSchedulesResponse ListSchedulesResponse + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", request.DashboardId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSchedulesResponse) + return &listSchedulesResponse, err +} + +func (a *lakeviewImpl) ListSubscriptions(ctx context.Context, request ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) { + var listSubscriptionsResponse ListSubscriptionsResponse + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v/subscriptions", request.DashboardId, request.ScheduleId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listSubscriptionsResponse) + return &listSubscriptionsResponse, err +} + func (a *lakeviewImpl) Migrate(ctx context.Context, request MigrateDashboardRequest) (*Dashboard, error) { var dashboard Dashboard path := "/api/2.0/lakeview/dashboards/migrate" @@ -90,3 +164,13 @@ func (a *lakeviewImpl) Update(ctx context.Context, request UpdateDashboardReques err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &dashboard) return &dashboard, err } + +func (a *lakeviewImpl) UpdateSchedule(ctx context.Context, request UpdateScheduleRequest) (*Schedule, error) { + var schedule Schedule + path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules/%v", request.DashboardId, request.ScheduleId) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPut, path, headers, request, &schedule) + return &schedule, err +} diff --git a/service/dashboards/interface.go b/service/dashboards/interface.go index cdc6b8d00..e8e491caa 100755 --- a/service/dashboards/interface.go +++ b/service/dashboards/interface.go @@ -16,6 +16,18 @@ type LakeviewService interface { // Create a draft dashboard. Create(ctx context.Context, request CreateDashboardRequest) (*Dashboard, error) + // Create dashboard schedule. + CreateSchedule(ctx context.Context, request CreateScheduleRequest) (*Schedule, error) + + // Create schedule subscription. + CreateSubscription(ctx context.Context, request CreateSubscriptionRequest) (*Subscription, error) + + // Delete dashboard schedule. + DeleteSchedule(ctx context.Context, request DeleteScheduleRequest) error + + // Delete schedule subscription. + DeleteSubscription(ctx context.Context, request DeleteSubscriptionRequest) error + // Get dashboard. // // Get a draft dashboard. @@ -26,6 +38,22 @@ type LakeviewService interface { // Get the current published dashboard. GetPublished(ctx context.Context, request GetPublishedDashboardRequest) (*PublishedDashboard, error) + // Get dashboard schedule. + GetSchedule(ctx context.Context, request GetScheduleRequest) (*Schedule, error) + + // Get schedule subscription. + GetSubscription(ctx context.Context, request GetSubscriptionRequest) (*Subscription, error) + + // List dashboard schedules. + // + // Use ListSchedulesAll() to get all Schedule instances, which will iterate over every result page. + ListSchedules(ctx context.Context, request ListSchedulesRequest) (*ListSchedulesResponse, error) + + // List schedule subscriptions. + // + // Use ListSubscriptionsAll() to get all Subscription instances, which will iterate over every result page. + ListSubscriptions(ctx context.Context, request ListSubscriptionsRequest) (*ListSubscriptionsResponse, error) + // Migrate dashboard. // // Migrates a classic SQL dashboard to Lakeview. @@ -50,4 +78,7 @@ type LakeviewService interface { // // Update a draft dashboard. Update(ctx context.Context, request UpdateDashboardRequest) (*Dashboard, error) + + // Update dashboard schedule. + UpdateSchedule(ctx context.Context, request UpdateScheduleRequest) (*Schedule, error) } diff --git a/service/dashboards/model.go b/service/dashboards/model.go index 23dd8e858..3b8d07f52 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -30,6 +30,51 @@ func (s CreateDashboardRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateScheduleRequest struct { + // The cron expression describing the frequency of the periodic refresh for + // this schedule. + CronSchedule CronSchedule `json:"cron_schedule"` + // UUID identifying the dashboard to which the schedule belongs. + DashboardId string `json:"-" url:"-"` + // The display name for schedule. + DisplayName string `json:"display_name,omitempty"` + // The status indicates whether this schedule is paused or not. + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *CreateScheduleRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s CreateScheduleRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type CreateSubscriptionRequest struct { + // UUID identifying the dashboard to which the subscription belongs. + DashboardId string `json:"-" url:"-"` + // UUID identifying the schedule to which the subscription belongs. + ScheduleId string `json:"-" url:"-"` + // Subscriber details for users and destinations to be added as subscribers + // to the schedule. + Subscriber Subscriber `json:"subscriber"` +} + +type CronSchedule struct { + // A cron expression using quartz syntax. EX: `0 0 8 * * ?` represents + // everyday at 8am. See [Cron Trigger] for details. + // + // [Cron Trigger]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html + QuartzCronExpression string `json:"quartz_cron_expression"` + // A Java timezone id. The schedule will be resolved with respect to this + // timezone. See [Java TimeZone] for details. + // + // [Java TimeZone]: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html + TimezoneId string `json:"timezone_id"` +} + type Dashboard struct { // The timestamp of when the dashboard was created. CreateTime string `json:"create_time,omitempty"` @@ -65,6 +110,56 @@ func (s Dashboard) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Delete dashboard schedule +type DeleteScheduleRequest struct { + // UUID identifying the dashboard to which the schedule belongs. + DashboardId string `json:"-" url:"-"` + // The etag for the schedule. Optionally, it can be provided to verify that + // the schedule has not been modified from its last retrieval. + Etag string `json:"-" url:"etag,omitempty"` + // UUID identifying the schedule. + ScheduleId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-"` +} + +func (s *DeleteScheduleRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteScheduleRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DeleteScheduleResponse struct { +} + +// Delete schedule subscription +type DeleteSubscriptionRequest struct { + // UUID identifying the dashboard which the subscription belongs. + DashboardId string `json:"-" url:"-"` + // The etag for the subscription. Can be optionally provided to ensure that + // the subscription has not been modified since the last read. + Etag string `json:"-" url:"etag,omitempty"` + // UUID identifying the schedule which the subscription belongs. + ScheduleId string `json:"-" url:"-"` + // UUID identifying the subscription. + SubscriptionId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-"` +} + +func (s *DeleteSubscriptionRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s DeleteSubscriptionRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type DeleteSubscriptionResponse struct { +} + // Get dashboard type GetDashboardRequest struct { // UUID identifying the dashboard. @@ -77,6 +172,24 @@ type GetPublishedDashboardRequest struct { DashboardId string `json:"-" url:"-"` } +// Get dashboard schedule +type GetScheduleRequest struct { + // UUID identifying the dashboard to which the schedule belongs. + DashboardId string `json:"-" url:"-"` + // UUID identifying the schedule. + ScheduleId string `json:"-" url:"-"` +} + +// Get schedule subscription +type GetSubscriptionRequest struct { + // UUID identifying the dashboard which the subscription belongs. + DashboardId string `json:"-" url:"-"` + // UUID identifying the schedule which the subscription belongs. + ScheduleId string `json:"-" url:"-"` + // UUID identifying the subscription. + SubscriptionId string `json:"-" url:"-"` +} + type LifecycleState string const LifecycleStateActive LifecycleState = `ACTIVE` @@ -104,6 +217,88 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } +// List dashboard schedules +type ListSchedulesRequest struct { + // UUID identifying the dashboard to which the schedule belongs. + DashboardId string `json:"-" url:"-"` + // The number of schedules to return per page. + PageSize int `json:"-" url:"page_size,omitempty"` + // A page token, received from a previous `ListSchedules` call. Use this to + // retrieve the subsequent page. + PageToken string `json:"-" url:"page_token,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListSchedulesRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSchedulesRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSchedulesResponse struct { + // A token that can be used as a `page_token` in subsequent requests to + // retrieve the next page of results. If this field is omitted, there are no + // subsequent schedules. + NextPageToken string `json:"next_page_token,omitempty"` + + Schedules []Schedule `json:"schedules,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListSchedulesResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSchedulesResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +// List schedule subscriptions +type ListSubscriptionsRequest struct { + // UUID identifying the dashboard to which the subscription belongs. + DashboardId string `json:"-" url:"-"` + // The number of subscriptions to return per page. + PageSize int `json:"-" url:"page_size,omitempty"` + // A page token, received from a previous `ListSubscriptions` call. Use this + // to retrieve the subsequent page. + PageToken string `json:"-" url:"page_token,omitempty"` + // UUID identifying the schedule to which the subscription belongs. + ScheduleId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListSubscriptionsRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSubscriptionsRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type ListSubscriptionsResponse struct { + // A token that can be used as a `page_token` in subsequent requests to + // retrieve the next page of results. If this field is omitted, there are no + // subsequent subscriptions. + NextPageToken string `json:"next_page_token,omitempty"` + + Subscriptions []Subscription `json:"subscriptions,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *ListSubscriptionsResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type MigrateDashboardRequest struct { // Display name for the new Lakeview dashboard. DisplayName string `json:"display_name,omitempty"` @@ -167,6 +362,118 @@ func (s PublishedDashboard) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type Schedule struct { + // A timestamp indicating when the schedule was created. + CreateTime string `json:"create_time,omitempty"` + // The cron expression describing the frequency of the periodic refresh for + // this schedule. + CronSchedule CronSchedule `json:"cron_schedule"` + // UUID identifying the dashboard to which the schedule belongs. + DashboardId string `json:"dashboard_id,omitempty"` + // The display name for schedule. + DisplayName string `json:"display_name,omitempty"` + // The etag for the schedule. Must be left empty on create, must be provided + // on updates to ensure that the schedule has not been modified since the + // last read, and can be optionally provided on delete. + Etag string `json:"etag,omitempty"` + // The status indicates whether this schedule is paused or not. + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + // UUID identifying the schedule. + ScheduleId string `json:"schedule_id,omitempty"` + // A timestamp indicating when the schedule was last updated. + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *Schedule) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Schedule) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type SchedulePauseStatus string + +const SchedulePauseStatusPaused SchedulePauseStatus = `PAUSED` + +const SchedulePauseStatusUnpaused SchedulePauseStatus = `UNPAUSED` + +// String representation for [fmt.Print] +func (f *SchedulePauseStatus) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *SchedulePauseStatus) Set(v string) error { + switch v { + case `PAUSED`, `UNPAUSED`: + *f = SchedulePauseStatus(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "PAUSED", "UNPAUSED"`, v) + } +} + +// Type always returns SchedulePauseStatus to satisfy [pflag.Value] interface +func (f *SchedulePauseStatus) Type() string { + return "SchedulePauseStatus" +} + +type Subscriber struct { + // The destination to receive the subscription email. This parameter is + // mutually exclusive with `user_subscriber`. + DestinationSubscriber *SubscriptionSubscriberDestination `json:"destination_subscriber,omitempty"` + // The user to receive the subscription email. This parameter is mutually + // exclusive with `destination_subscriber`. + UserSubscriber *SubscriptionSubscriberUser `json:"user_subscriber,omitempty"` +} + +type Subscription struct { + // A timestamp indicating when the subscription was created. + CreateTime string `json:"create_time,omitempty"` + // UserId of the user who adds subscribers (users or notification + // destinations) to the dashboard's schedule. + CreatedByUserId int64 `json:"created_by_user_id,omitempty"` + // UUID identifying the dashboard to which the subscription belongs. + DashboardId string `json:"dashboard_id,omitempty"` + // The etag for the subscription. Must be left empty on create, can be + // optionally provided on delete to ensure that the subscription has not + // been deleted since the last read. + Etag string `json:"etag,omitempty"` + // UUID identifying the schedule to which the subscription belongs. + ScheduleId string `json:"schedule_id,omitempty"` + // Subscriber details for users and destinations to be added as subscribers + // to the schedule. + Subscriber Subscriber `json:"subscriber"` + // UUID identifying the subscription. + SubscriptionId string `json:"subscription_id,omitempty"` + // A timestamp indicating when the subscription was last updated. + UpdateTime string `json:"update_time,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Subscription) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type SubscriptionSubscriberDestination struct { + // The canonical identifier of the destination to receive email + // notification. + DestinationId string `json:"destination_id"` +} + +type SubscriptionSubscriberUser struct { + // UserId of the subscriber. + UserId int64 `json:"user_id"` +} + // Trash dashboard type TrashDashboardRequest struct { // UUID identifying the dashboard. @@ -208,3 +515,31 @@ func (s *UpdateDashboardRequest) UnmarshalJSON(b []byte) error { func (s UpdateDashboardRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } + +type UpdateScheduleRequest struct { + // The cron expression describing the frequency of the periodic refresh for + // this schedule. + CronSchedule CronSchedule `json:"cron_schedule"` + // UUID identifying the dashboard to which the schedule belongs. + DashboardId string `json:"-" url:"-"` + // The display name for schedule. + DisplayName string `json:"display_name,omitempty"` + // The etag for the schedule. Must be left empty on create, must be provided + // on updates to ensure that the schedule has not been modified since the + // last read, and can be optionally provided on delete. + Etag string `json:"etag,omitempty"` + // The status indicates whether this schedule is paused or not. + PauseStatus SchedulePauseStatus `json:"pause_status,omitempty"` + // UUID identifying the schedule. + ScheduleId string `json:"-" url:"-"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdateScheduleRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateScheduleRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} diff --git a/service/iam/model.go b/service/iam/model.go index 55e4ccf6b..c2f2067d1 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -329,7 +329,7 @@ type Group struct { Groups []ComplexValue `json:"groups,omitempty"` // Databricks group ID - Id string `json:"id,omitempty"` + Id string `json:"id,omitempty" url:"-"` Members []ComplexValue `json:"members,omitempty"` // Container for the group identifier. Workspace local versus account. @@ -1231,7 +1231,7 @@ type ServicePrincipal struct { Groups []ComplexValue `json:"groups,omitempty"` // Databricks service principal ID. - Id string `json:"id,omitempty"` + Id string `json:"id,omitempty" url:"-"` // Corresponds to AWS instance profile/arn role. Roles []ComplexValue `json:"roles,omitempty"` // The schema of the List response. @@ -1317,7 +1317,7 @@ type User struct { Groups []ComplexValue `json:"groups,omitempty"` // Databricks user ID. This is automatically set by Databricks. Any value // provided by the client will be ignored. - Id string `json:"id,omitempty" url:"-"` + Id string `json:"id,omitempty"` Name *Name `json:"name,omitempty"` // Corresponds to AWS instance profile/arn role. diff --git a/service/jobs/model.go b/service/jobs/model.go index 3981a1f18..7a17a360d 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -1704,6 +1704,43 @@ func (f *PauseStatus) Type() string { return "PauseStatus" } +type PeriodicTriggerConfiguration struct { + Interval int `json:"interval"` + + Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"` +} + +type PeriodicTriggerConfigurationTimeUnit string + +const PeriodicTriggerConfigurationTimeUnitDays PeriodicTriggerConfigurationTimeUnit = `DAYS` + +const PeriodicTriggerConfigurationTimeUnitHours PeriodicTriggerConfigurationTimeUnit = `HOURS` + +const PeriodicTriggerConfigurationTimeUnitTimeUnitUnspecified PeriodicTriggerConfigurationTimeUnit = `TIME_UNIT_UNSPECIFIED` + +const PeriodicTriggerConfigurationTimeUnitWeeks PeriodicTriggerConfigurationTimeUnit = `WEEKS` + +// String representation for [fmt.Print] +func (f *PeriodicTriggerConfigurationTimeUnit) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *PeriodicTriggerConfigurationTimeUnit) Set(v string) error { + switch v { + case `DAYS`, `HOURS`, `TIME_UNIT_UNSPECIFIED`, `WEEKS`: + *f = PeriodicTriggerConfigurationTimeUnit(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DAYS", "HOURS", "TIME_UNIT_UNSPECIFIED", "WEEKS"`, v) + } +} + +// Type always returns PeriodicTriggerConfigurationTimeUnit to satisfy [pflag.Value] interface +func (f *PeriodicTriggerConfigurationTimeUnit) Type() string { + return "PeriodicTriggerConfigurationTimeUnit" +} + type PipelineParams struct { // If true, triggers a full refresh on the delta live table. FullRefresh bool `json:"full_refresh,omitempty"` @@ -3881,6 +3918,8 @@ type TriggerSettings struct { FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` // Whether this trigger is paused or not. PauseStatus PauseStatus `json:"pause_status,omitempty"` + + Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"` // Old table trigger settings name. Deprecated in favor of `table_update`. Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 97d104003..1c615f354 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -978,7 +978,7 @@ type PipelineLibrary struct { // Specification of a maven library to be installed. Maven *compute.MavenLibrary `json:"maven,omitempty"` // The path to a notebook that defines a pipeline and is stored in the - // workspace. + // Databricks workspace. Notebook *NotebookLibrary `json:"notebook,omitempty"` ForceSendFields []string `json:"-"` diff --git a/service/serving/model.go b/service/serving/model.go index 72d976efb..472d7a34d 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -83,6 +83,10 @@ type App struct { // The pending deployment of the app. PendingDeployment *AppDeployment `json:"pending_deployment,omitempty"` + ServicePrincipalId int64 `json:"service_principal_id,omitempty"` + + ServicePrincipalName string `json:"service_principal_name,omitempty"` + Status *AppStatus `json:"status,omitempty"` // The update time of the app. Formatted timestamp in ISO 6801. UpdateTime string `json:"update_time,omitempty"` diff --git a/service/sql/model.go b/service/sql/model.go index e08608ba1..c7db41440 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -1326,7 +1326,9 @@ type ExecuteStatementRequest struct { // determines what should happen after the timeout is reached. WaitTimeout string `json:"wait_timeout,omitempty"` // Warehouse upon which to execute a statement. See also [What are SQL - // warehouses?](/sql/admin/warehouse-type.html) + // warehouses?] + // + // [What are SQL warehouses?]: https://docs.databricks.com/sql/admin/warehouse-type.html WarehouseId string `json:"warehouse_id"` ForceSendFields []string `json:"-"` @@ -3065,9 +3067,10 @@ type StatementParameterListItem struct { // The data type, given as a string. For example: `INT`, `STRING`, // `DECIMAL(10,2)`. If no type is given the type is assumed to be `STRING`. // Complex types, such as `ARRAY`, `MAP`, and `STRUCT` are not supported. - // For valid types, refer to the section [Data - // types](/sql/language-manual/functions/cast.html) of the SQL language + // For valid types, refer to the section [Data types] of the SQL language // reference. + // + // [Data types]: https://docs.databricks.com/sql/language-manual/functions/cast.html Type string `json:"type,omitempty"` // The value to substitute, represented as a string. If omitted, the value // is interpreted as NULL. From d098b1a3e77a41948d9ad63f674be9d42520bc2f Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Fri, 7 Jun 2024 17:02:47 +0200 Subject: [PATCH 8/8] Support partners in SDK (#925) ## Changes Partners of Databricks need a mechanism to register themselves in libraries or applications that they write. In this way, requests made by users of those libraries will include sufficient information to link those requests to the original users. This PR adds a new function `WithPartner` that can be used by a partner to add partner information to the User-Agent header for requests made by the SDK. The new header will have the form `partner/`. The partner identifier is opaque for the SDK, but it must be alphanumeric. This PR also lifts the requirement that there may only be a single copy of an entry in the user agent. This allows multiple partners to register themselves in the same library or application. ## Tests Unit tests for user agent were modified to support multiple entries for the same header key. A unit test is added to cover the WithProduct method. - [ ] `make test` passing - [ ] `make fmt` applied - [ ] relevant integration tests applied --- README.md | 20 ++++++++++++++++++++ examples/useragent/main.go | 23 +++++++++++++++++++++++ useragent/user_agent.go | 18 +++++------------- useragent/user_agent_test.go | 12 ++++++++++-- 4 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 examples/useragent/main.go diff --git a/README.md b/README.md index e4bcbbc9f..a299507ee 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ The Databricks SDK for Go includes functionality to accelerate development with - [GetByName utility methods](#getbyname-utility-methods) - [Node type and Databricks Runtime selectors](#node-type-and-databricks-runtime-selectors) - [Integration with `io` interfaces for DBFS](#integration-with-io-interfaces-for-dbfs) +- [User Agent Request Attribution](#user-agent-request-attribution) - [Error Handling](#error-handling) - [Logging](#logging) - [Testing](#testing) @@ -531,6 +532,25 @@ buf, err := w.Dbfs.ReadFile(ctx, "/path/to/remote/file") Databricks SDK for Go loosely integrates with [spf13/pflag](https://github.com/spf13/pflag) by implementing [pflag.Value](https://pkg.go.dev/github.com/spf13/pflag#Value) for all enum types. +## User Agent Request Attribution + +The Databricks SDK for Go uses the `User-Agent` header to include request metadata along with each request. By default, this includes the version of the Go SDK, the version of the Go language used by your application, and the underlying operating system. To statically add additional metadata, you can use the `WithPartner()` and `WithProduct()` functions in the `useragent` package. `WithPartner()` can be used by partners to indicate that code using the Databricks SDK for Go should be attributed to a specific partner. Multiple partners can be registered at once. Partner names can contain any number, digit, `.`, `-`, `_` or `+`. + +```go +useragent.WithPartner("partner-abc") +useragent.WithPartner("partner-xyz") +``` + +`WithProduct()` can be used to define the name and version of the product that is built with the Databricks SDK for Go. The product name has the same restrictions as the partner name above, and the product version must be a valid [SemVer](https://semver.org/). Subsequent calls to `WithProduct()` replace the original product with the new user-specified one. + +```go +useragent.WithProduct("databricks-example-product", "1.2.0") +``` + +If both the `DATABRICKS_SDK_UPSTREAM` and `DATABRICKS_SDK_UPSTREAM_VERSION` environment variables are defined, these will also be included in the `User-Agent` header. + +If additional metadata needs to be specified that isn't already supported by the above interfaces, you can use the `WithUserAgentExtra()` function to register arbitrary key-value pairs to include in the user agent. Multiple values associated with the same key are allowed. Keys have the same restrictions as the partner name above. Values must be either as described above or SemVer strings. + ## Error handling The Databricks SDK for Go converts error responses from the Databricks API into the [`apierr.APIError`](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/apierr#APIError) type. This allows you to inspect the error code, message, and details by asserting the error as `apierr.APIError`: diff --git a/examples/useragent/main.go b/examples/useragent/main.go new file mode 100644 index 000000000..7d54d577e --- /dev/null +++ b/examples/useragent/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "context" + + "github.com/databricks/databricks-sdk-go" + "github.com/databricks/databricks-sdk-go/useragent" +) + +// Run this example by running `go run ./examples/useragent` from the root of this repository. +// +// To run this example, ensure that you have a DEFAULT profile configured in your `.databrickscfg`. +func main() { + useragent.WithProduct("databricks-sdk-example", "0.0.1") + useragent.WithPartner("databricks-sdk-example-abc") + useragent.WithPartner("databricks-sdk-example-def") + useragent.WithUserAgentExtra("test-key", "test-value") + w := databricks.Must(databricks.NewWorkspaceClient()) + _, err := w.CurrentUser.Me(context.Background()) + if err != nil { + panic(err) + } +} diff --git a/useragent/user_agent.go b/useragent/user_agent.go index bd9dc7af5..627c6ce10 100644 --- a/useragent/user_agent.go +++ b/useragent/user_agent.go @@ -52,6 +52,10 @@ func WithUserAgentExtra(key, value string) { extra = extra.With(key, value) } +func WithPartner(partner string) { + WithUserAgentExtra("partner", partner) +} + func getUpstreamUserAgentInfo() []info { product := os.Getenv("DATABRICKS_SDK_UPSTREAM") version := os.Getenv("DATABRICKS_SDK_UPSTREAM_VERSION") @@ -114,19 +118,7 @@ func (d data) With(key, value string) data { if err := matchAlphanumOrSemVer(value); err != nil { panic(err) } - var c data - var found bool - for _, i := range d { - if i.Key == key { - i.Value = value - found = true - } - c = append(c, i) - } - if !found { - c = append(c, info{key, value}) - } - return c + return append(d, info{key, value}) } func (d data) String() string { diff --git a/useragent/user_agent_test.go b/useragent/user_agent_test.go index fda9a02cc..8707dbeea 100644 --- a/useragent/user_agent_test.go +++ b/useragent/user_agent_test.go @@ -49,11 +49,11 @@ func TestFromContext_Custom(t *testing.T) { userAgent2 := FromContext(ctx2) // tests may be developed and run on different versions of different things - expectedFormat := "unit-tests/0.0.1 databricks-sdk-go/%s go/%s os/%s pulumi/3.8.4 terraform/1.3.6 a/e" + expectedFormat := "unit-tests/0.0.1 databricks-sdk-go/%s go/%s os/%s pulumi/3.8.4 terraform/1.3.4 terraform/1.3.5 terraform/1.3.6 a/b a/d a/e" expected := fmt.Sprintf(expectedFormat, version.Version, goVersion(), runtime.GOOS) assert.Equal(t, expected, userAgent) - expectedFormat2 := "unit-tests/0.0.1 databricks-sdk-go/%s go/%s os/%s pulumi/3.8.4 terraform/1.3.6 a/f foo/bar" + expectedFormat2 := "unit-tests/0.0.1 databricks-sdk-go/%s go/%s os/%s pulumi/3.8.4 terraform/1.3.4 terraform/1.3.5 terraform/1.3.6 a/b a/d a/e a/f foo/bar" expected2 := fmt.Sprintf(expectedFormat2, version.Version, goVersion(), runtime.GOOS) assert.Equal(t, expected2, userAgent2) @@ -74,3 +74,11 @@ func TestFromContext_Custom(t *testing.T) { func TestDefaultsAreValid(t *testing.T) { WithProduct(productName, productVersion) } + +func TestMultiplePartners(t *testing.T) { + WithPartner("partner1") + WithPartner("partner2") + userAgent := FromContext(context.Background()) + assert.Contains(t, userAgent, "partner/partner1") + assert.Contains(t, userAgent, "partner/partner2") +}